G
Guest
basically, I need to port this part of an app into C#:
byte[] data // some compressed data separated from a Stream
Inflater inf = new Inflater();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
inf.setInput(data, 0, data.length);
byte[] result = new byte[1024];
int resLen;
while ((resLen = inf.inflate(result)) > 0) {
buffer.write(result, 0, resLen);
}
inf.end();
I tried using SharpZipLib but they don't see to have a way to simplay call
inflate on a specific byte array, they have a filter Stream so it makes it
ore compicated to do what I wanted. And when I tried it, I got a "EOF not
found" tpye of error... I just used MemoryStream instead of the byte array as
the input, and wrote the data from my byte array into the MemoryStream.
any suggestions? thanks!
byte[] data // some compressed data separated from a Stream
Inflater inf = new Inflater();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
inf.setInput(data, 0, data.length);
byte[] result = new byte[1024];
int resLen;
while ((resLen = inf.inflate(result)) > 0) {
buffer.write(result, 0, resLen);
}
inf.end();
I tried using SharpZipLib but they don't see to have a way to simplay call
inflate on a specific byte array, they have a filter Stream so it makes it
ore compicated to do what I wanted. And when I tried it, I got a "EOF not
found" tpye of error... I just used MemoryStream instead of the byte array as
the input, and wrote the data from my byte array into the MemoryStream.
any suggestions? thanks!