Skip to content

Instantly share code, notes, and snippets.

View LanHikari22's full-sized avatar
📡

Lan LanHikari22

📡
  • Minneapolis MN, US
View GitHub Profile
@Prof9
Prof9 / LZ77Decompress.cs
Created August 28, 2014 20:05
GBA LZ decompression function in C#
/// <summary>
/// Decompresses LZ77-compressed data from the given input stream.
/// </summary>
/// <param name="input">The input stream to read from.</param>
/// <returns>The decompressed data.</returns>
public static MemoryStream Decompress(Stream input) {
BinaryReader reader = new BinaryReader(input);
// Check LZ77 type.
if (reader.ReadByte() != 0x10)