iText 7 7.1.8 API
iText.IO.Source.WindowRandomAccessSource Class Reference

A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over a specific length. More...

Inheritance diagram for iText.IO.Source.WindowRandomAccessSource:
iText.IO.Source.IRandomAccessSource

Public Member Functions

  WindowRandomAccessSource (IRandomAccessSource source, long offset)
  Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source More...
 
  WindowRandomAccessSource (IRandomAccessSource source, long offset, long length)
  Constructs a new OffsetRandomAccessSource with an explicit length More...
 
virtual int  Get (long position)
  Gets a byte at the specified position Note that the position will be adjusted to read from the corrected location in the underlying source More...
 
virtual 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. Note that the position will be adjusted to read from the corrected location in the underlying source More...
 
virtual long  Length ()
  Gets the length of the source Note that the length will be adjusted to read from the corrected location in the underlying source More...
 
virtual void  Close ()
  Closes this source. More...
 

Detailed Description

A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over a specific length.

A RandomAccessSource that wraps another RandomAccessSource and provides a window of it at a specific offset and over a specific length. Position 0 becomes the offset position in the underlying source.

Constructor & Destructor Documentation

◆ WindowRandomAccessSource() [1/2]

iText.IO.Source.WindowRandomAccessSource.WindowRandomAccessSource ( IRandomAccessSource  source,
long  offset 
)
inline

Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source

Parameters
source the source
offset the amount of the offset to use

◆ WindowRandomAccessSource() [2/2]

iText.IO.Source.WindowRandomAccessSource.WindowRandomAccessSource ( IRandomAccessSource  source,
long  offset,
long  length 
)
inline

Constructs a new OffsetRandomAccessSource with an explicit length

Parameters
source the source
offset the amount of the offset to use
length the number of bytes to be included in this RAS

Member Function Documentation

◆ Close()

virtual void iText.IO.Source.WindowRandomAccessSource.Close ( )
inlinevirtual

Closes this source.

Exceptions
System.IO.IOException

Implements iText.IO.Source.IRandomAccessSource.

◆ Get() [1/2]

virtual int iText.IO.Source.WindowRandomAccessSource.Get ( long  position )
inlinevirtual

Gets a byte at the specified position Note that the position will be adjusted to read from the corrected location in the underlying source

Exceptions
System.IO.IOException

Implements iText.IO.Source.IRandomAccessSource.

◆ Get() [2/2]

virtual int iText.IO.Source.WindowRandomAccessSource.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. Note that the position will be adjusted to read from the corrected location in the underlying source

Exceptions
System.IO.IOException

Implements iText.IO.Source.IRandomAccessSource.

◆ Length()

virtual long iText.IO.Source.WindowRandomAccessSource.Length ( )
inlinevirtual

Gets the length of the source Note that the length will be adjusted to read from the corrected location in the underlying source

Implements iText.IO.Source.IRandomAccessSource.