iText 8.0.5 API
iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource Class Reference
Inheritance diagram for iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource:
iText.IO.Source.IRandomAccessSource

Public Member Functions

  ReusableRandomAccessSource (ByteBuffer buffer)
 
virtual int  Get (long offset)
  Gets a byte at the specified position More...
 
virtual int  Get (long offset, 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...
 
virtual long  Length ()
  Gets the length of the source More...
 
virtual void  Close ()
  Closes this source. More...
 

Member Function Documentation

◆ Close()

virtual void iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource.Close ( )
inlinevirtual

Closes this source.

Closes this source. The underlying data structure or source (if any) will also be closed

Implements iText.IO.Source.IRandomAccessSource.

◆ Get() [1/2]

virtual int iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource.Get ( long  position )
inlinevirtual

Gets a byte at the specified position

Parameters
position byte position
Returns
the byte, or -1 if EOF is reached

Implements iText.IO.Source.IRandomAccessSource.

◆ Get() [2/2]

virtual int iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource.Get ( long  position,
byte[]  bytes,
int  off,
int  len 
)
inlinevirtual

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.

Parameters
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
Returns
the number of bytes actually read, or -1 if the file is at EOF

Implements iText.IO.Source.IRandomAccessSource.

◆ Length()

virtual long iText.Kernel.Pdf.PdfReader.ReusableRandomAccessSource.Length ( )
inlinevirtual

Gets the length of the source

Returns
the length of this source

Implements iText.IO.Source.IRandomAccessSource.