C# Class Nintenlord.GBA.Compressions.LZ77

Show file Open project: Diegoisawesome/AwesomeMapEditor-old

Public Methods

Method Description
CanBeUnCompressed ( BinaryReader br, int offset ) : bool

Checks weather the data can be uncompressed.

CanBeUnCompressed ( BinaryReader br, int offset, int minSize, int maxSize ) : bool

Checks if data can be uncompressed.

CanBeUnCompressed ( byte source, int maxLenght ) : bool

Checks if data can be uncompressed

CanBeUnCompressed ( byte source, int minSize, int maxSize ) : bool

Checks if data can be uncompressed

CanBeUnCompressed ( byte data, int offset, int minSize, int maxSize ) : bool

Checks if data can be uncompressed

CanBeUnCompressed ( int offset, BinaryReader br ) : bool

Checks weather the data can be uncompressed.

Compress ( BinaryReader br, int offset, int size ) : byte[]
Compress ( byte unCompressedData ) : byte[]
Compress ( byte source, int lenght ) : byte[]

Compresses data with LZ77

Compress ( byte data, int index, int length ) : byte[]

Compresses data with LZ77

Compress ( uint UncompressedData ) : byte[]

Compresses from UInt32 to byte

Decompress ( BinaryReader br, int offset, byte destination ) : bool

Decompresses LZ77 data

Decompress ( byte source, byte target ) : bool

Decompresses LZ77 data

Decompress ( BinaryReader br, int offset ) : byte[]

Decompresses LZ77 data

Decompress ( byte source ) : byte[]

Decompresses LZ77 data

Decompress ( byte data, int offset ) : byte[]

Decompresses LZ77 data

GetCompressedDataLenght ( BinaryReader br, int offset, int &lenght ) : bool

Gets the lenght of the compressed data in a stream

GetCompressedDataLenght ( byte source, int &lenght ) : bool

Gets the lenght of the compressed data

GetCompressedDataLenght ( BinaryReader br, int offset ) : int

Gets the lenght of the compressed data

GetCompressedDataLenght ( byte source ) : int

Gets the lenght of the compressed data

GetCompressedDataLenght ( byte data, int offset ) : int

Gets the lenght of the compressed data

Scan ( BinaryReader br ) : int[]
Scan ( BinaryReader br, int offset, int size ) : int[]

Scans the stream for potential LZ77 compressions

Scan ( BinaryReader br, int offset, int amount, int sizeMultible, int minSize, int maxSize ) : int[]

Scans the stream for potential LZ77 compressions

Scan ( byte pointer, int amount ) : int[]

Scans an area in memory for potentian LZ77 compressions

Scan ( byte pointer, int amount, int sizeMultible, int minSize, int maxSize ) : int[]

Scans an area in memory for potential LZ77 compressions

Scan ( byte data, int offset, int amount, int sizeMultible, int minSize, int maxSize ) : int[]

Scans the data for potential LZ77 compressions

UnCompress ( BinaryReader br, int offset, byte destination ) : bool

Uncompresser LZ77 data from a stream

UnCompress ( byte source, byte target ) : bool

Uncompresser LZ77 data

UnCompress ( BinaryReader br, int offset ) : byte[]
UnCompress ( byte CompressedData ) : byte[]
UnCompressToUInt32 ( BinaryReader br, int offset ) : uint[]

Uncompresses to Uint32

Private Methods

Method Description
Search ( List SlidingWindow, byte ReadAheadBuffer ) : int[]
Search ( byte source, int position, int lenght ) : int[]

Method Details

CanBeUnCompressed() public static method

Checks weather the data can be uncompressed.
public static CanBeUnCompressed ( BinaryReader br, int offset ) : bool
br System.IO.BinaryReader Stream where the compressed data is.
offset int Offset of the compressed data in the stream.
return bool

CanBeUnCompressed() public static method

Checks if data can be uncompressed.
public static CanBeUnCompressed ( BinaryReader br, int offset, int minSize, int maxSize ) : bool
br System.IO.BinaryReader Stream where the compressed data is
offset int Offset of the compressed data in the stream
minSize int
maxSize int
return bool

CanBeUnCompressed() public static method

Checks if data can be uncompressed
public static CanBeUnCompressed ( byte source, int maxLenght ) : bool
source byte Pointer to beginning of data
maxLenght int
return bool

CanBeUnCompressed() public static method

Checks if data can be uncompressed
public static CanBeUnCompressed ( byte source, int minSize, int maxSize ) : bool
source byte Pointer to beginning of data
minSize int
maxSize int
return bool

CanBeUnCompressed() public static method

Checks if data can be uncompressed
public static CanBeUnCompressed ( byte data, int offset, int minSize, int maxSize ) : bool
data byte Data with data to test
offset int Offset of the data to test in data
minSize int
maxSize int
return bool

CanBeUnCompressed() public static method

Checks weather the data can be uncompressed.
public static CanBeUnCompressed ( int offset, BinaryReader br ) : bool
offset int Offset of the compressed data in the stream.
br System.IO.BinaryReader Stream where the compressed data is.
return bool

Compress() public method

public Compress ( BinaryReader br, int offset, int size ) : byte[]
br System.IO.BinaryReader
offset int
size int
return byte[]

Compress() public method

public Compress ( byte unCompressedData ) : byte[]
unCompressedData byte
return byte[]

Compress() public static method

Compresses data with LZ77
public static Compress ( byte source, int lenght ) : byte[]
source byte Pointer to beginning of the data
lenght int Lenght of the data to compress in bytes
return byte[]

Compress() public static method

Compresses data with LZ77
public static Compress ( byte data, int index, int length ) : byte[]
data byte Data to compress
index int Beginning offset of the data to compress
length int Length of the data to compress
return byte[]

Compress() public static method

Compresses from UInt32 to byte
public static Compress ( uint UncompressedData ) : byte[]
UncompressedData uint Array of uncompressed data
return byte[]

Decompress() public static method

Decompresses LZ77 data
public static Decompress ( BinaryReader br, int offset, byte destination ) : bool
br System.IO.BinaryReader Stream where the compressed data is
offset int Position of the compressed data
destination byte Pointer to where uncompressed data goes
return bool

Decompress() public static method

Decompresses LZ77 data
public static Decompress ( byte source, byte target ) : bool
source byte Pointer to compressed data
target byte Pointer to where uncompressed data goes
return bool

Decompress() public static method

Decompresses LZ77 data
public static Decompress ( BinaryReader br, int offset ) : byte[]
br System.IO.BinaryReader Stream where compressed data is
offset int Offset of the compressed data in the stream
return byte[]

Decompress() public static method

Decompresses LZ77 data
public static Decompress ( byte source ) : byte[]
source byte Pointer to data to decompress
return byte[]

Decompress() public static method

Decompresses LZ77 data
public static Decompress ( byte data, int offset ) : byte[]
data byte Data where compressed data is
offset int Offset of the compressed data
return byte[]

GetCompressedDataLenght() public static method

Gets the lenght of the compressed data in a stream
public static GetCompressedDataLenght ( BinaryReader br, int offset, int &lenght ) : bool
br System.IO.BinaryReader The stream with data
offset int The position of the data in stream
lenght int
return bool

GetCompressedDataLenght() public static method

Gets the lenght of the compressed data
public static GetCompressedDataLenght ( byte source, int &lenght ) : bool
source byte Pointer to the data
lenght int Lenght of the compressed data
return bool

GetCompressedDataLenght() public static method

Gets the lenght of the compressed data
public static GetCompressedDataLenght ( BinaryReader br, int offset ) : int
br System.IO.BinaryReader The stream with data
offset int The position of the data in stream
return int

GetCompressedDataLenght() public static method

Gets the lenght of the compressed data
public static GetCompressedDataLenght ( byte source ) : int
source byte Pointer to the data to check
return int

GetCompressedDataLenght() public static method

Gets the lenght of the compressed data
public static GetCompressedDataLenght ( byte data, int offset ) : int
data byte Data where compressed data is
offset int The position of the data
return int

Scan() public method

public Scan ( BinaryReader br ) : int[]
br System.IO.BinaryReader
return int[]

Scan() public static method

Scans the stream for potential LZ77 compressions
public static Scan ( BinaryReader br, int offset, int size ) : int[]
br System.IO.BinaryReader Stream to scan.
offset int
size int
return int[]

Scan() public static method

Scans the stream for potential LZ77 compressions
public static Scan ( BinaryReader br, int offset, int amount, int sizeMultible, int minSize, int maxSize ) : int[]
br System.IO.BinaryReader Stream to scan
offset int
amount int
sizeMultible int
minSize int
maxSize int
return int[]

Scan() public static method

Scans an area in memory for potentian LZ77 compressions
public static Scan ( byte pointer, int amount ) : int[]
pointer byte Pointer to start of area to scan
amount int Size of the area to scan in bytes
return int[]

Scan() public static method

Scans an area in memory for potential LZ77 compressions
public static Scan ( byte pointer, int amount, int sizeMultible, int minSize, int maxSize ) : int[]
pointer byte Pointer to start of area to scan
amount int Size of the area to scan in bytes
sizeMultible int
minSize int
maxSize int
return int[]

Scan() public static method

Scans the data for potential LZ77 compressions
public static Scan ( byte data, int offset, int amount, int sizeMultible, int minSize, int maxSize ) : int[]
data byte Data to scan
offset int Starting offset of are to scan
amount int Size of the area to scan
sizeMultible int
minSize int
maxSize int
return int[]

UnCompress() public static method

Uncompresser LZ77 data from a stream
public static UnCompress ( BinaryReader br, int offset, byte destination ) : bool
br System.IO.BinaryReader Stream where the compressed data is
offset int Position of the compressed data
destination byte Pointer to where uncompressed data goes
return bool

UnCompress() public static method

Uncompresser LZ77 data
public static UnCompress ( byte source, byte target ) : bool
source byte Pointer to compressed data
target byte Pointer to where uncompressed data goes
return bool

UnCompress() public method

public UnCompress ( BinaryReader br, int offset ) : byte[]
br System.IO.BinaryReader
offset int
return byte[]

UnCompress() public method

public UnCompress ( byte CompressedData ) : byte[]
CompressedData byte
return byte[]

UnCompressToUInt32() public static method

Uncompresses to Uint32
public static UnCompressToUInt32 ( BinaryReader br, int offset ) : uint[]
br System.IO.BinaryReader Stream where the data to uncompress is
offset int Offset of the data
return uint[]