Table of Contents

Class RandomAccessFileOrArray

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

An implementation of a RandomAccessFile for input only that accepts a file or a byte array as data source. @author Paulo Soares (psoares@consiste.pt)

public class RandomAccessFileOrArray
Inheritance
RandomAccessFileOrArray
Inherited Members

Constructors

RandomAccessFileOrArray(byte[])

public RandomAccessFileOrArray(byte[] arrayIn)

Parameters

arrayIn byte[]

RandomAccessFileOrArray(Stream, bool)

public RandomAccessFileOrArray(Stream isp, bool forceRead = true)

Parameters

isp Stream
forceRead bool

RandomAccessFileOrArray(string)

public RandomAccessFileOrArray(string filename)

Parameters

filename string

RandomAccessFileOrArray(string, bool)

public RandomAccessFileOrArray(string filename, bool forceRead)

Parameters

filename string
forceRead bool

RandomAccessFileOrArray(Uri)

public RandomAccessFileOrArray(Uri url)

Parameters

url Uri

RandomAccessFileOrArray(RandomAccessFileOrArray)

public RandomAccessFileOrArray(RandomAccessFileOrArray file)

Parameters

file RandomAccessFileOrArray

Properties

FilePointer

public int FilePointer { get; }

Property Value

int

Length

public int Length { get; }

Property Value

int

StartOffset

Holds value of property startOffset.

public int StartOffset { get; set; }

Property Value

int

Methods

Close()

public void Close()

InputStreamToArray(Stream)

public static byte[] InputStreamToArray(Stream isp)

Parameters

isp Stream

Returns

byte[]

InsureOpen()

protected void InsureOpen()

IsOpen()

public bool IsOpen()

Returns

bool

PushBack(byte)

public void PushBack(byte b)

Parameters

b byte

ReOpen()

public void ReOpen()

Read()

public int Read()

Returns

int

Read(byte[])

public int Read(byte[] b)

Parameters

b byte[]

Returns

int

Read(byte[], int, int)

public int Read(byte[] b, int off, int len)

Parameters

b byte[]
off int
len int

Returns

int

ReadBoolean()

public bool ReadBoolean()

Returns

bool

ReadByte()

public byte ReadByte()

Returns

byte

ReadChar()

public char ReadChar()

Returns

char

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. This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown. @exception EOFException if this stream reaches the end before reading two bytes. @exception IOException if an I/O error occurs.

public char ReadCharLe()

Returns

char

the next two bytes of this stream as a Unicode character.

ReadDouble()

public double ReadDouble()

Returns

double

ReadDoubleLe()

public double ReadDoubleLe()

Returns

double

ReadFloat()

public float ReadFloat()

Returns

float

ReadFloatLe()

public float ReadFloatLe()

Returns

float

ReadFully(byte[])

public void ReadFully(byte[] b)

Parameters

b byte[]

ReadFully(byte[], int, int)

public void ReadFully(byte[] b, int off, int len)

Parameters

b byte[]
off int
len int

ReadInt()

public int ReadInt()

Returns

int

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. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown. int . @exception EOFException if this stream reaches the end before reading four bytes. @exception IOException if an I/O error occurs.

public int ReadIntLe()

Returns

int

the next four bytes of this stream, interpreted as an

ReadLine()

public string ReadLine()

Returns

string

ReadLong()

public long ReadLong()

Returns

long

ReadLongLe()

public long ReadLongLe()

Returns

long

ReadShort()

public short ReadShort()

Returns

short

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, 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. 16-bit number. @exception EOFException if this stream reaches the end before reading two bytes. @exception IOException if an I/O error occurs.

public short ReadShortLe()

Returns

short

the next two bytes of this stream, interpreted as a signed

ReadUnsignedByte()

public int ReadUnsignedByte()

Returns

int

ReadUnsignedInt()

Reads an unsigned 32-bit integer from this stream. This method reads 4 bytes from the stream, starting at the current stream pointer. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown. long . @exception EOFException if this stream reaches the end before reading four bytes. @exception IOException if an I/O error occurs.

public long ReadUnsignedInt()

Returns

long

the next four bytes of this stream, interpreted as a

ReadUnsignedIntLe()

public long ReadUnsignedIntLe()

Returns

long

ReadUnsignedShort()

public int ReadUnsignedShort()

Returns

int

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. This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown. unsigned 16-bit integer. @exception EOFException if this stream reaches the end before reading two bytes. @exception IOException if an I/O error occurs.

public int ReadUnsignedShortLe()

Returns

int

the next two bytes of this stream, interpreted as an

Seek(int)

public void Seek(int pos)

Parameters

pos int

Seek(long)

public void Seek(long pos)

Parameters

pos long

Skip(long)

public long Skip(long n)

Parameters

n long

Returns

long

SkipBytes(int)

public int SkipBytes(int n)

Parameters

n int

Returns

int