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
IOException
public RandomAccessFileOrArray(String filename, boolean forceRead, boolean plainRandomAccess) throws IOException
IOException
public RandomAccessFileOrArray(URL url) throws IOException
IOException
public RandomAccessFileOrArray(InputStream is) throws IOException
IOException
public RandomAccessFileOrArray(byte[] arrayIn)
public RandomAccessFileOrArray(RandomAccessFileOrArray file)
public static byte[] InputStreamToArray(InputStream is) throws IOException
IOException
public void pushBack(byte b)
public int read() throws IOException
IOException
public int read(byte[] b, int off, int len) throws IOException
IOException
public int read(byte[] b) throws IOException
IOException
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public long skip(long n) throws IOException
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public void reOpen() throws IOException
IOException
protected void insureOpen() throws IOException
IOException
public boolean isOpen()
public void close() throws IOException
IOException
public int length() throws IOException
IOException
public void seek(int pos) throws IOException
IOException
public void seek(long pos) throws IOException
IOException
public int getFilePointer() throws IOException
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public byte readByte() throws IOException
readByte
in interface DataInput
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public short readShort() throws IOException
readShort
in interface DataInput
IOException
public 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 DataInput
IOException
public 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 DataInput
IOException
public 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 DataInput
IOException
public 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
IOException
public long readLong() throws IOException
readLong
in interface DataInput
IOException
public final long readLongLE() throws IOException
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public final float readFloatLE() throws IOException
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public final double readDoubleLE() throws IOException
IOException
public String readLine() throws IOException
readLine
in interface DataInput
IOException
public String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public int getStartOffset()
public void setStartOffset(int startOffset)
startOffset
- New value of property startOffset.public ByteBuffer getNioByteBuffer() throws IOException
IOException
Copyright © 2018. All rights reserved.