iText 7 7.1.8 API
iText.Kernel.Pdf.Filters.LZWDecoder Class Reference

A class for performing LZW decoding. More...

Public Member Functions

  LZWDecoder ()
  Creates an LZWDecoder instance. More...
 
virtual void  Decode (byte[] data, Stream uncompData)
  Method to decode LZW compressed data. More...
 
virtual void  InitializeStringTable ()
  Initialize the string table. More...
 
virtual void  WriteString (byte[] @string)
  Write out the string just uncompressed. More...
 
virtual void  AddStringToTable (byte[] oldString, byte newString)
  Add a new string to the string table. More...
 
virtual void  AddStringToTable (byte[] @string)
  Add a new string to the string table. More...
 
virtual byte[]  ComposeString (byte[] oldString, byte newString)
  Append More...
 
virtual int  GetNextCode ()
  Attempt to get the next code. More...
 

Detailed Description

A class for performing LZW decoding.

Constructor & Destructor Documentation

◆ LZWDecoder()

iText.Kernel.Pdf.Filters.LZWDecoder.LZWDecoder ( )
inline

Creates an LZWDecoder instance.

Member Function Documentation

◆ AddStringToTable() [1/2]

virtual void iText.Kernel.Pdf.Filters.LZWDecoder.AddStringToTable ( byte @[]  string )
inlinevirtual

Add a new string to the string table.

Parameters
string byte[] to store in the string table

◆ AddStringToTable() [2/2]

virtual void iText.Kernel.Pdf.Filters.LZWDecoder.AddStringToTable ( byte[]  oldString,
byte  newString 
)
inlinevirtual

Add a new string to the string table.

Parameters
oldString stored string
newString string to be appended to the stored string

◆ ComposeString()

virtual byte [] iText.Kernel.Pdf.Filters.LZWDecoder.ComposeString ( byte[]  oldString,
byte  newString 
)
inlinevirtual

Append

newString to the end of oldString.

Parameters
oldString string be appended to
newString string that is to be appended to oldString
Returns
combined string

◆ Decode()

virtual void iText.Kernel.Pdf.Filters.LZWDecoder.Decode ( byte[]  data,
Stream  uncompData 
)
inlinevirtual

Method to decode LZW compressed data.

Parameters
data The compressed data.
uncompData Array to return the uncompressed data in.

◆ GetNextCode()

virtual int iText.Kernel.Pdf.Filters.LZWDecoder.GetNextCode ( )
inlinevirtual

Attempt to get the next code.

Attempt to get the next code. Exceptions are caught to make this robust to cases wherein the EndOfInformation code has been omitted from a strip. Examples of such cases have been observed in practice.

Returns
next code

◆ InitializeStringTable()

virtual void iText.Kernel.Pdf.Filters.LZWDecoder.InitializeStringTable ( )
inlinevirtual

Initialize the string table.

◆ WriteString()

virtual void iText.Kernel.Pdf.Filters.LZWDecoder.WriteString ( byte @[]  string )
inlinevirtual

Write out the string just uncompressed.

Parameters
string content to write to the uncompressed data