com.lowagie.text.pdf
public class RandomAccessFileOrArray extends Object implements DataInput
Field Summary | |
---|---|
byte[] | arrayIn |
int | arrayInPtr |
byte | back |
String | filename |
boolean | isBack |
MappedRandomAccessFile | rf |
int | startOffset Holds value of property startOffset. |
Constructor Summary | |
---|---|
RandomAccessFileOrArray(String filename) | |
RandomAccessFileOrArray(String filename, boolean forceRead) | |
RandomAccessFileOrArray(URL url) | |
RandomAccessFileOrArray(InputStream is) | |
RandomAccessFileOrArray(byte[] arrayIn) | |
RandomAccessFileOrArray(RandomAccessFileOrArray file) |
Method Summary | |
---|---|
void | close() |
int | getFilePointer() |
int | getStartOffset() Getter for property startOffset. |
protected void | insureOpen() |
boolean | isOpen() |
static byte[] | InputStreamToArray(InputStream is) |
int | length() |
void | pushBack(byte b) |
int | read() |
int | read(byte[] b, int off, int len) |
int | read(byte[] b) |
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) |
Returns: Value of property startOffset.
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.
Returns: the next two bytes of this stream as a Unicode character.
Throws: EOFException if this stream reaches the end before reading two bytes. IOException if an I/O error occurs.
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.
Returns: the next four bytes of this stream, interpreted as an
int
.
Throws: EOFException if this stream reaches the end before reading four bytes. IOException if an I/O error occurs.
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.
Returns: the next two bytes of this stream, interpreted as a signed 16-bit number.
Throws: EOFException if this stream reaches the end before reading two bytes. IOException if an I/O error occurs.
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.
Returns: the next four bytes of this stream, interpreted as a
long
.
Throws: EOFException if this stream reaches the end before reading four bytes. IOException if an I/O error occurs.
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.
Returns: the next two bytes of this stream, interpreted as an unsigned 16-bit integer.
Throws: EOFException if this stream reaches the end before reading two bytes. IOException if an I/O error occurs.
Parameters: startOffset New value of property startOffset.