C# Class Nintenlord.ROMHacking.GBA.Compressions.LZ77

显示文件 Open project: Diegoisawesome/AwesomeMapEditor-old

Public Methods

Method Description
CanBeUnCompressed ( BinaryReader br, int offset, int minSize, int maxSize ) : 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

Compress ( BinaryReader br, int lenght ) : byte[]

Compresses data with LZ77

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

Compresses data with LZ77

Compress ( byte data ) : byte[]

Compresses data with LZ77

Compress ( byte source, int lenght ) : byte[]

Compresses data with LZ77

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

Compresses data with LZ77

CompressTo ( BinaryWriter writer, BinaryReader reader, int length ) : void

Compress data with LZ77

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

Decompresses LZ77 data

Decompress ( Stream input, Stream output ) : bool
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

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 offset, int amount, int sizeMultible, int minSize, int maxSize ) : int[]

Scans the stream for potential 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

Private Methods

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

Method Details

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 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

Compress() public static method

Compresses data with LZ77
public static Compress ( BinaryReader br, int lenght ) : byte[]
br System.IO.BinaryReader Stream to compress data from
lenght int Length of the data to compress
return byte[]

Compress() public static method

Compresses data with LZ77
public static Compress ( BinaryReader br, int offset, int lenght ) : byte[]
br System.IO.BinaryReader Stream to compress data from
offset int Offset of the data to compress
lenght int Length of the data to compress
return byte[]

Compress() public static method

Compresses data with LZ77
public static Compress ( byte data ) : byte[]
data byte Data to compress
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[]

CompressTo() public static method

Compress data with LZ77
public static CompressTo ( BinaryWriter writer, BinaryReader reader, int length ) : void
writer System.IO.BinaryWriter Stream to write compressed data to
reader System.IO.BinaryReader Stream to compress data from
length int Amount of data to compress
return void

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

public static Decompress ( Stream input, Stream output ) : bool
input System.IO.Stream
output System.IO.Stream
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
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 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 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[]