public class RandomAccessInputStreamImpl extends InputStream implements RandomAccessInputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buffer |
protected int |
bufferLength |
protected File |
localFile |
protected int |
mark |
protected RandomAccessFile |
raFile |
protected int |
readPointer |
protected File |
tmpFile |
| Constructor and Description |
|---|
RandomAccessInputStreamImpl(File file)
Constructor for RandomAccessInputStreamImpl
|
RandomAccessInputStreamImpl(String fileName)
Constructor for RandomAccessInputStreamImpl
|
RandomAccessInputStreamImpl(URL fromUrl) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
File |
getFile()
Will return the local file this RandomAccessFile works on
or null using local buffer and no file
|
long |
getFilePointer() |
long |
getLength() |
long |
length() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
int |
readFully(byte[] b) |
int |
readFully(byte[] b,
int offs,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
reset() |
void |
seek(long pos) |
long |
skip(long n) |
int |
skipBytes(int n)
Mapping to RandomAccessFile
|
protected RandomAccessFile raFile
protected File localFile
protected File tmpFile
protected int mark
protected byte[] buffer
protected int readPointer
protected int bufferLength
public RandomAccessInputStreamImpl(File file) throws IOException, FileNotFoundException
file - FileNotFoundExceptionIOExceptionpublic RandomAccessInputStreamImpl(String fileName) throws IOException, FileNotFoundException
fileName - FileNotFoundExceptionIOExceptionpublic RandomAccessInputStreamImpl(URL fromUrl) throws IOException, FileNotFoundException
IOExceptionFileNotFoundExceptionpublic File getFile()
getFile in interface RandomAccessInputStreampublic int available()
throws IOException
available in interface RandomAccessInputStreamavailable in class InputStreamIOExceptionInputStream.available()public void close()
throws IOException
close in interface RandomAccessInputStreamclose in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionInputStream.close()public void mark(int readlimit)
mark in interface RandomAccessInputStreammark in class InputStreamreadlimit - InputStream.mark(int)public boolean markSupported()
markSupported in interface RandomAccessInputStreammarkSupported in class InputStreamInputStream.markSupported()public int read()
throws IOException
read in interface RandomAccessInputStreamread in class InputStreamIOExceptionInputStream.read()public int read(byte[] b,
int off,
int len)
throws IOException
read in interface RandomAccessInputStreamread in class InputStreamb - off - len - IOExceptionInputStream.read(byte[], int, int)public int read(byte[] b)
throws IOException
read in interface RandomAccessInputStreamread in class InputStreamb - IOExceptionInputStream.read(byte[])public void reset()
throws IOException
reset in interface RandomAccessInputStreamreset in class InputStreamIOExceptionInputStream.reset()public long skip(long n)
throws IOException
skip in interface RandomAccessInputStreamskip in class InputStreamn - IOExceptionInputStream.skip(long)public int skipBytes(int n)
throws IOException
skipBytes in interface RandomAccessInputStreamIOExceptionpublic long getFilePointer()
throws IOException
getFilePointer in interface RandomAccessInputStreamIOExceptionpublic void seek(long pos)
throws IOException
seek in interface RandomAccessInputStreamIOExceptionpublic byte readByte()
throws IOException
readByte in interface RandomAccessInputStreamIOExceptionpublic long getLength()
throws IOException
getLength in interface RandomAccessInputStreamIOExceptionpublic long length()
throws IOException
length in interface RandomAccessInputStreamIOExceptionpublic int readFully(byte[] b)
throws IOException
readFully in interface RandomAccessInputStreamIOExceptionpublic int readFully(byte[] b,
int offs,
int len)
throws IOException
readFully in interface RandomAccessInputStreamIOExceptionpublic boolean readBoolean()
throws IOException
readBoolean in interface RandomAccessInputStreamIOExceptionpublic char readChar()
throws IOException
readChar in interface RandomAccessInputStreamIOExceptionpublic short readShort()
throws IOException
readShort in interface RandomAccessInputStreamIOExceptionpublic double readDouble()
throws IOException
readDouble in interface RandomAccessInputStreamIOExceptionpublic float readFloat()
throws IOException
readFloat in interface RandomAccessInputStreamIOExceptionpublic int readInt()
throws IOException
readInt in interface RandomAccessInputStreamIOExceptionpublic String readLine() throws IOException
readLine in interface RandomAccessInputStreamIOExceptionpublic long readLong()
throws IOException
readLong in interface RandomAccessInputStreamIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface RandomAccessInputStreamIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface RandomAccessInputStreamIOExceptionpublic String readUTF() throws IOException
readUTF in interface RandomAccessInputStreamIOExceptionCopyright © 2014. All rights reserved.