Class RandomAccessFileOrArray
java.lang.Object
com.gitlab.pdftk_java.com.lowagie.text.pdf.RandomAccessFileOrArray
- All Implemented Interfaces:
DataInput
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) intprivate byte(package private) String/private boolean(package private) RandomAccessFileprivate int -
Constructor Summary
ConstructorsConstructorDescriptionRandomAccessFileOrArray(byte[] arrayIn) RandomAccessFileOrArray(String filename) /RandomAccessFileOrArray(String filename, boolean forceRead) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()intgetBack()intintprivate void/protected voidbooleanisBack()booleanisOpen()intlength()intpopBack()voidpushBack(byte b) intread()intread(byte[] b) intread(byte[] bb, int off, int len) boolean/bytereadByte()charreadChar()final charReads a Unicode character from this stream in little-endian order.doublefinal doublefloatfinal floatvoidreadFully(byte[] bb) voidreadFully(byte[] bb, int off, int len) intreadInt()final intReads a signed 32-bit integer from this stream in little-endian order.readLine()longreadLong()final longshortfinal shortReads a signed 16-bit number from this stream in little-endian order.intfinal longReads an unsigned 32-bit integer from this stream.final longintfinal intReads an unsigned 16-bit number from this stream in little-endian order.readUTF()voidreOpen()voidseek(int pos) voidseek(long pos) voidsetStartOffset(int startOffset) longskip(long n) intskipBytes(int nn)
-
Field Details
-
filename
String filename/ -
rf
-
arrayIn
byte[] arrayIn -
arrayInPtr
int arrayInPtr -
back
private byte back -
isBack
private boolean isBack -
startOffset
private int startOffset
-
-
Constructor Details
-
RandomAccessFileOrArray
-
RandomAccessFileOrArray
- Throws:
IOException
-
RandomAccessFileOrArray
- Throws:
IOException
-
RandomAccessFileOrArray
- Throws:
IOException
-
RandomAccessFileOrArray
public RandomAccessFileOrArray(byte[] arrayIn) -
RandomAccessFileOrArray
- Throws:
IOException
-
-
Method Details
-
inputStreamToArray
-
pushBack
- Throws:
IOException
-
popBack
public int popBack() -
isBack
public boolean isBack() -
getBack
public int getBack() -
clearBack
public void clearBack() -
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
reOpen
- Throws:
IOException
-
insureOpen
- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Throws:
IOException
-
length
- Throws:
IOException
-
getFilePointer
- Throws:
IOException
-
seek
- Throws:
IOException
-
seek
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
skip
- Throws:
IOException
-
getStartOffset
public int getStartOffset() -
setStartOffset
- Throws:
IOException
-
readBoolean
/- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readShortLE
Reads a signed 16-bit number from this stream in little-endian order. The method reads two bytes from this stream, starting at the current stream pointer. If the two bytes read, in order, areb1andb2, where each of the two values is between0and255, 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.
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShortLE
Reads an unsigned 16-bit number from this stream in little-endian order. This method reads two bytes from the stream, starting at the current stream pointer. If the bytes read, in order, areb1andb2, where0 <= b1, b2 <= 255, then the result is equal to:(b2 << 8) | b1This 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.
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readCharLE
Reads a Unicode character from this stream in little-endian order. This method reads two bytes from the stream, starting at the current stream pointer. If the bytes read, in order, areb1andb2, where0 <= 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.
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readIntLE
Reads a signed 32-bit integer from this stream in little-endian order. This method reads 4 bytes from the stream, starting at the current stream pointer. If the bytes read, in order, areb1,b2,b3, andb4, where0 <= b1, b2, b3, b4 <= 255, then the result is equal to:(b4 << 24) | (b3 << 16) + (b2 << 8) + b1This 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.
-
readUnsignedInt
Reads an unsigned 32-bit integer from this stream. This method reads 4 bytes from the stream, starting at the current stream pointer. If the bytes read, in order, areb1,b2,b3, andb4, where0 <= b1, b2, b3, b4 <= 255, then the result is equal to:(b1 << 24) | (b2 << 16) + (b3 << 8) + b4This 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.
-
readUnsignedIntLE
- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readLongLE
- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readFloatLE
- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readDoubleLE
- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-