iText 8.0.2 API
|
Represents an abstract source that bytes can be read from. More...
Public Member Functions |
|
int | Get (long position) |
Gets a byte at the specified position More... |
|
int | Get (long position, byte[] bytes, int off, int len) |
Read an array of bytes of specified length from the specified position of source to the buffer applying the offset. More... |
|
long | Length () |
Gets the length of the source More... |
|
void | Close () |
Closes this source. More... |
|
Represents an abstract source that bytes can be read from.
Represents an abstract source that bytes can be read from. This class forms the foundation for all byte input in iText. Implementations do not keep track of a current 'position', but rather provide absolute get methods. Tracking position should be handled in classes that use RandomAccessSource internally (via composition).
void iText.IO.Source.IRandomAccessSource.Close | ( | ) |
Closes this source.
Closes this source. The underlying data structure or source (if any) will also be closed
Implemented in iText.IO.Source.WindowRandomAccessSource, iText.IO.Source.GetBufferedRandomAccessSource, iText.IO.Source.IndependentRandomAccessSource, and iText.IO.Source.ThreadSafeRandomAccessSource.
int iText.IO.Source.IRandomAccessSource.Get | ( | long | position | ) |
Gets a byte at the specified position
position | byte position |
Implemented in iText.IO.Source.WindowRandomAccessSource, iText.IO.Source.GetBufferedRandomAccessSource, iText.IO.Source.IndependentRandomAccessSource, and iText.IO.Source.ThreadSafeRandomAccessSource.
int iText.IO.Source.IRandomAccessSource.Get | ( | long | position, |
byte[] | bytes, | ||
int | off, | ||
int | len | ||
) |
Read an array of bytes of specified length from the specified position of source to the buffer applying the offset.
Read an array of bytes of specified length from the specified position of source to the buffer applying the offset. If the number of bytes requested cannot be read, all the possible bytes will be read to the buffer, and the number of actually read bytes will be returned.
position | the position in the RandomAccessSource to read from |
bytes | output buffer |
off | offset into the output buffer where results will be placed |
len | the number of bytes to read |
Implemented in iText.IO.Source.WindowRandomAccessSource, iText.IO.Source.GetBufferedRandomAccessSource, iText.IO.Source.IndependentRandomAccessSource, and iText.IO.Source.ThreadSafeRandomAccessSource.
long iText.IO.Source.IRandomAccessSource.Length | ( | ) |
Gets the length of the source
Implemented in iText.IO.Source.WindowRandomAccessSource, iText.IO.Source.GetBufferedRandomAccessSource, iText.IO.Source.IndependentRandomAccessSource, and iText.IO.Source.ThreadSafeRandomAccessSource.