GBA.LZ77.Compress C# (CSharp) Method

Compress() public static method

public static Compress ( byte data ) : byte[]
data byte
return byte[]
        public static byte[] Compress(byte[] data)
        {
            return Compress(data, 0, data.Length);
        }

Same methods

LZ77::Compress ( byte data, int address, int length ) : byte[]

Usage Example

Example #1
0
        /// <summary>
        /// Returns the tiles of this Tileset (empty 0th tile excluded) written sequentially in a byte array
        /// </summary>
        public byte[] ToBytes(bool compressed)
        {
            byte[] result = new byte[Count * GBA.Tile.LENGTH];
            int    index  = 0;

            for (int i = 0; i < Count; i++)
            {
                Array.Copy(Sheet[i].Bytes, 0, result, index, Sheet[i].Bytes.Length);
                index += Sheet[i].Bytes.Length;
            }

            return(compressed ? LZ77.Compress(result) : result);
        }
All Usage Examples Of GBA.LZ77::Compress