iText 8.0.2 API
|
Class that is used to unify reading from random access files and arrays. More...
Public Member Functions |
|
RandomAccessFileOrArray (IRandomAccessSource byteSource) | |
Creates a RandomAccessFileOrArray that wraps the specified byte source. More... |
|
virtual iText.IO.Source.RandomAccessFileOrArray | CreateView () |
Creates an independent view of this object (with it's own file pointer and push back queue). More... |
|
virtual IRandomAccessSource | CreateSourceView () |
Creates the view of the byte source of this object. More... |
|
virtual void | PushBack (byte b) |
Pushes a byte back. More... |
|
virtual int | Read () |
Reads a single byte More... |
|
virtual int | Read (byte[] b, int off, int len) |
Reads the specified amount of bytes to the buffer applying the offset. More... |
|
virtual int | Read (byte[] b) |
Reads the bytes to the buffer. More... |
|
virtual void | ReadFully (byte[] b) |
virtual void | ReadFully (byte[] b, int off, int len) |
virtual long | Skip (long n) |
Make an attempt to skip the specified amount of bytes in source. More... |
|
virtual int | SkipBytes (int n) |
virtual void | Close () |
Closes the underlying source. More... |
|
virtual long | Length () |
Gets the total amount of bytes in the source. More... |
|
virtual void | Seek (long pos) |
Sets the current position in the source to the specified index. More... |
|
virtual long | GetPosition () |
Gets the current position of the source considering the pushed byte to the source. More... |
|
virtual bool | ReadBoolean () |
virtual byte | ReadByte () |
virtual int | ReadUnsignedByte () |
virtual short | ReadShort () |
short | ReadShortLE () |
Reads a signed 16-bit number from this stream in little-endian order. More... |
|
virtual int | ReadUnsignedShort () |
int | ReadUnsignedShortLE () |
Reads an unsigned 16-bit number from this stream in little-endian order. More... |
|
virtual char | ReadChar () |
char | ReadCharLE () |
Reads a Unicode character from this stream in little-endian order. More... |
|
virtual int | ReadInt () |
int | ReadIntLE () |
Reads a signed 32-bit integer from this stream in little-endian order. More... |
|
long | ReadUnsignedInt () |
Reads an unsigned 32-bit integer from this stream. More... |
|
long | ReadUnsignedIntLE () |
virtual long | ReadLong () |
long | ReadLongLE () |
virtual float | ReadFloat () |
float | ReadFloatLE () |
virtual double | ReadDouble () |
double | ReadDoubleLE () |
virtual String | ReadLine () |
virtual String | ReadString (int length, String encoding) |
Reads a String from the font file as bytes using the given encoding. More... |
|
Static Public Attributes |
|
static bool | plainRandomAccess = false |
When true the file access is not done through a memory mapped file. More... |
|
Class that is used to unify reading from random access files and arrays.
|
inline |
Creates a RandomAccessFileOrArray that wraps the specified byte source.
Creates a RandomAccessFileOrArray that wraps the specified byte source. The byte source will be closed when this RandomAccessFileOrArray is closed.
byteSource | the byte source to wrap |
|
inlinevirtual |
Closes the underlying source.
|
inlinevirtual |
Creates the view of the byte source of this object.
Creates the view of the byte source of this object. Closing the view won't affect this object. Closing source will have adverse effect on the view.
|
inlinevirtual |
Creates an independent view of this object (with it's own file pointer and push back queue).
Creates an independent view of this object (with it's own file pointer and push back queue). Closing the new object will not close this object. Closing this object will have adverse effect on the view.
|
inlinevirtual |
Gets the current position of the source considering the pushed byte to the source.
|
inlinevirtual |
Gets the total amount of bytes in the source.
|
inlinevirtual |
Pushes a byte back.
Pushes a byte back. The next get() will return this byte instead of the value from the underlying data source
b | the byte to push |
|
inlinevirtual |
Reads a single byte
|
inlinevirtual |
Reads the bytes to the buffer.
Reads the bytes to the buffer. This method will try to read as many bytes as the buffer can hold.
b | the destination buffer |
|
inlinevirtual |
Reads the specified amount of bytes to the buffer applying the offset.
b | destination buffer |
off | offset at which to start storing characters |
len | maximum number of characters to read |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Reads a Unicode character from this stream in little-endian order.
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, are 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.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Reads a signed 32-bit integer from this stream in little-endian order.
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, are 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
.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Reads a signed 16-bit number from this stream in little-endian order.
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, are 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.
|
inlinevirtual |
Reads a String
from the font file as bytes using the given encoding.
length | the length of bytes to read |
encoding | the given encoding |
String
read
|
inlinevirtual |
|
inline |
Reads an unsigned 32-bit integer from this stream.
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, are 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
.
|
inlinevirtual |
|
inline |
Reads an unsigned 16-bit number from this stream in little-endian order.
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, are 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.
|
inlinevirtual |
Sets the current position in the source to the specified index.
pos | the position to set |
|
inlinevirtual |
Make an attempt to skip the specified amount of bytes in source.
Make an attempt to skip the specified amount of bytes in source. However it may skip less amount of bytes. Possibly zero.
n | the number of bytes to skip |
|
inlinevirtual |
|
static |
When true the file access is not done through a memory mapped file.
When true the file access is not done through a memory mapped file. Use it if the file is too big to be mapped in your address space.