| Constructor and Description |
|---|
RandomAccessFileOrArray(byte[] arrayIn) |
RandomAccessFileOrArray(InputStream is) |
RandomAccessFileOrArray(RandomAccessFileOrArray file) |
RandomAccessFileOrArray(String filename) |
RandomAccessFileOrArray(String filename,
boolean forceRead,
boolean plainRandomAccess) |
RandomAccessFileOrArray(URL url) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getFilePointer() |
ByteBuffer |
getNioByteBuffer() |
int |
getStartOffset()
Getter for property startOffset.
|
static byte[] |
InputStreamToArray(InputStream is) |
protected void |
insureOpen() |
boolean |
isOpen() |
int |
length() |
void |
pushBack(byte b) |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
char |
readCharLE()
Reads a Unicode character from this stream in little-endian order.
|
double |
readDouble() |
double |
readDoubleLE() |
float |
readFloat() |
float |
readFloatLE() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
int |
readIntLE()
Reads a signed 32-bit integer from this stream in little-endian order.
|
String |
readLine() |
long |
readLong() |
long |
readLongLE() |
short |
readShort() |
short |
readShortLE()
Reads a signed 16-bit number from this stream in little-endian order.
|
int |
readUnsignedByte() |
long |
readUnsignedInt()
Reads an unsigned 32-bit integer from this stream.
|
long |
readUnsignedIntLE() |
int |
readUnsignedShort() |
int |
readUnsignedShortLE()
Reads an unsigned 16-bit number from this stream in little-endian order.
|
String |
readUTF() |
void |
reOpen() |
void |
seek(int pos) |
void |
seek(long pos) |
void |
setStartOffset(int startOffset)
Setter for property startOffset.
|
long |
skip(long n) |
int |
skipBytes(int n) |
public RandomAccessFileOrArray(String filename) throws IOException
IOExceptionpublic RandomAccessFileOrArray(String filename, boolean forceRead, boolean plainRandomAccess) throws IOException
IOExceptionpublic RandomAccessFileOrArray(URL url) throws IOException
IOExceptionpublic RandomAccessFileOrArray(InputStream is) throws IOException
IOExceptionpublic RandomAccessFileOrArray(byte[] arrayIn)
public RandomAccessFileOrArray(RandomAccessFileOrArray file)
public static byte[] InputStreamToArray(InputStream is) throws IOException
IOExceptionpublic void pushBack(byte b)
public int read()
throws IOException
IOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic int read(byte[] b)
throws IOException
IOExceptionpublic void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOExceptionpublic long skip(long n)
throws IOException
IOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic void reOpen()
throws IOException
IOExceptionprotected void insureOpen()
throws IOException
IOExceptionpublic boolean isOpen()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int length()
throws IOException
IOExceptionpublic void seek(int pos)
throws IOException
IOExceptionpublic void seek(long pos)
throws IOException
IOExceptionpublic int getFilePointer()
throws IOException
IOExceptionpublic boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic byte readByte()
throws IOException
readByte in interface DataInputIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputIOExceptionpublic final short readShortLE()
throws IOException
b1 and b2, where each of the two values is
between 0 and 255, inclusive, then the
result is equal to:
(short)((b2 << 8) | b1)
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
EOFException - if this stream reaches the end before reading
two bytes.IOException - if an I/O error occurs.public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOExceptionpublic final int readUnsignedShortLE()
throws IOException
b1 and b2, where
0 <= b1, b2 <= 255,
then the result is equal to:
(b2 << 8) | b1
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
EOFException - if this stream reaches the end before reading
two bytes.IOException - if an I/O error occurs.public char readChar()
throws IOException
readChar in interface DataInputIOExceptionpublic final char readCharLE()
throws IOException
b1 and b2, where
0 <= b1, b2 <= 255,
then the result is equal to:
(char)((b2 << 8) | b1)
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
EOFException - if this stream reaches the end before reading
two bytes.IOException - if an I/O error occurs.public int readInt()
throws IOException
readInt in interface DataInputIOExceptionpublic final int readIntLE()
throws IOException
b1,
b2, b3, and b4, where
0 <= b1, b2, b3, b4 <= 255,
then the result is equal to:
(b4 << 24) | (b3 << 16) + (b2 << 8) + b1
This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.
int.EOFException - if this stream reaches the end before reading
four bytes.IOException - if an I/O error occurs.public final long readUnsignedInt()
throws IOException
b1,
b2, b3, and b4, where
0 <= b1, b2, b3, b4 <= 255,
then the result is equal to:
(b1 << 24) | (b2 << 16) + (b3 << 8) + b4
This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.
long.EOFException - if this stream reaches the end before reading
four bytes.IOException - if an I/O error occurs.public final long readUnsignedIntLE()
throws IOException
IOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputIOExceptionpublic final long readLongLE()
throws IOException
IOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputIOExceptionpublic final float readFloatLE()
throws IOException
IOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputIOExceptionpublic final double readDoubleLE()
throws IOException
IOExceptionpublic String readLine() throws IOException
readLine in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOExceptionpublic int getStartOffset()
public void setStartOffset(int startOffset)
startOffset - New value of property startOffset.public ByteBuffer getNioByteBuffer() throws IOException
IOExceptionCopyright © 2019. All rights reserved.