|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.lowagie.text.pdf.RandomAccessFileOrArray
public class RandomAccessFileOrArray
An implementation of a RandomAccessFile for input only that accepts a file or a byte array as data source.
Constructor Summary | |
---|---|
RandomAccessFileOrArray(byte[] arrayIn)
|
|
RandomAccessFileOrArray(java.io.InputStream is)
|
|
RandomAccessFileOrArray(RandomAccessFileOrArray file)
|
|
RandomAccessFileOrArray(java.lang.String filename)
|
|
RandomAccessFileOrArray(java.lang.String filename,
boolean forceRead,
boolean plainRandomAccess)
|
|
RandomAccessFileOrArray(java.net.URL url)
|
Method Summary | |
---|---|
void |
close()
|
int |
getFilePointer()
|
java.nio.ByteBuffer |
getNioByteBuffer()
|
int |
getStartOffset()
Getter for property startOffset. |
static byte[] |
InputStreamToArray(java.io.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. |
java.lang.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. |
java.lang.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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomAccessFileOrArray(java.lang.String filename) throws java.io.IOException
java.io.IOException
public RandomAccessFileOrArray(java.lang.String filename, boolean forceRead, boolean plainRandomAccess) throws java.io.IOException
java.io.IOException
public RandomAccessFileOrArray(java.net.URL url) throws java.io.IOException
java.io.IOException
public RandomAccessFileOrArray(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public RandomAccessFileOrArray(byte[] arrayIn)
public RandomAccessFileOrArray(RandomAccessFileOrArray file)
Method Detail |
---|
public static byte[] InputStreamToArray(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void pushBack(byte b)
public int read() throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public int read(byte[] b) throws java.io.IOException
java.io.IOException
public void readFully(byte[] b) throws java.io.IOException
readFully
in interface java.io.DataInput
java.io.IOException
public void readFully(byte[] b, int off, int len) throws java.io.IOException
readFully
in interface java.io.DataInput
java.io.IOException
public long skip(long n) throws java.io.IOException
java.io.IOException
public int skipBytes(int n) throws java.io.IOException
skipBytes
in interface java.io.DataInput
java.io.IOException
public void reOpen() throws java.io.IOException
java.io.IOException
protected void insureOpen() throws java.io.IOException
java.io.IOException
public boolean isOpen()
public void close() throws java.io.IOException
java.io.IOException
public int length() throws java.io.IOException
java.io.IOException
public void seek(int pos) throws java.io.IOException
java.io.IOException
public void seek(long pos) throws java.io.IOException
java.io.IOException
public int getFilePointer() throws java.io.IOException
java.io.IOException
public boolean readBoolean() throws java.io.IOException
readBoolean
in interface java.io.DataInput
java.io.IOException
public byte readByte() throws java.io.IOException
readByte
in interface java.io.DataInput
java.io.IOException
public int readUnsignedByte() throws java.io.IOException
readUnsignedByte
in interface java.io.DataInput
java.io.IOException
public short readShort() throws java.io.IOException
readShort
in interface java.io.DataInput
java.io.IOException
public final short readShortLE() throws java.io.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.
java.io.EOFException
- if this stream reaches the end before reading
two bytes.
java.io.IOException
- if an I/O error occurs.public int readUnsignedShort() throws java.io.IOException
readUnsignedShort
in interface java.io.DataInput
java.io.IOException
public final int readUnsignedShortLE() throws java.io.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.
java.io.EOFException
- if this stream reaches the end before reading
two bytes.
java.io.IOException
- if an I/O error occurs.public char readChar() throws java.io.IOException
readChar
in interface java.io.DataInput
java.io.IOException
public final char readCharLE() throws java.io.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.
java.io.EOFException
- if this stream reaches the end before reading
two bytes.
java.io.IOException
- if an I/O error occurs.public int readInt() throws java.io.IOException
readInt
in interface java.io.DataInput
java.io.IOException
public final int readIntLE() throws java.io.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
.
java.io.EOFException
- if this stream reaches the end before reading
four bytes.
java.io.IOException
- if an I/O error occurs.public final long readUnsignedInt() throws java.io.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
.
java.io.EOFException
- if this stream reaches the end before reading
four bytes.
java.io.IOException
- if an I/O error occurs.public final long readUnsignedIntLE() throws java.io.IOException
java.io.IOException
public long readLong() throws java.io.IOException
readLong
in interface java.io.DataInput
java.io.IOException
public final long readLongLE() throws java.io.IOException
java.io.IOException
public float readFloat() throws java.io.IOException
readFloat
in interface java.io.DataInput
java.io.IOException
public final float readFloatLE() throws java.io.IOException
java.io.IOException
public double readDouble() throws java.io.IOException
readDouble
in interface java.io.DataInput
java.io.IOException
public final double readDoubleLE() throws java.io.IOException
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
readLine
in interface java.io.DataInput
java.io.IOException
public java.lang.String readUTF() throws java.io.IOException
readUTF
in interface java.io.DataInput
java.io.IOException
public int getStartOffset()
public void setStartOffset(int startOffset)
startOffset
- New value of property startOffset.public java.nio.ByteBuffer getNioByteBuffer() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |