mantis 8509: replace mesh gzip decompress
parent
7f55db72d2
commit
2739b2f5cc
|
@ -40,7 +40,7 @@ using OpenSim.Region.Framework;
|
|||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Framework.Capabilities;
|
||||
|
||||
using ComponentAce.Compression.Libs.zlib;
|
||||
using System.IO.Compression;
|
||||
|
||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||
|
@ -571,15 +571,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
{
|
||||
using (MemoryStream outMs = new MemoryStream())
|
||||
{
|
||||
using (ZOutputStream zOut = new ZOutputStream(outMs))
|
||||
using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress))
|
||||
{
|
||||
byte[] readBuffer = new byte[4096];
|
||||
byte[] readBuffer = new byte[2048];
|
||||
inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header
|
||||
int readLen = 0;
|
||||
while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0)
|
||||
{
|
||||
zOut.Write(readBuffer, 0, readLen);
|
||||
}
|
||||
zOut.Flush();
|
||||
|
||||
while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0)
|
||||
outMs.Write(readBuffer, 0, readLen);
|
||||
|
||||
outMs.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
byte[] decompressedBuf = outMs.GetBuffer();
|
||||
|
@ -638,15 +638,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
{
|
||||
using (MemoryStream outMs = new MemoryStream())
|
||||
{
|
||||
using (ZOutputStream zOut = new ZOutputStream(outMs))
|
||||
using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress))
|
||||
{
|
||||
byte[] readBuffer = new byte[4096];
|
||||
byte[] readBuffer = new byte[2048];
|
||||
inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header
|
||||
int readLen = 0;
|
||||
while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0)
|
||||
{
|
||||
zOut.Write(readBuffer, 0, readLen);
|
||||
}
|
||||
zOut.Flush();
|
||||
|
||||
while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0)
|
||||
outMs.Write(readBuffer, 0, readLen);
|
||||
|
||||
outMs.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
byte[] decompressedBuf = outMs.GetBuffer();
|
||||
|
|
Loading…
Reference in New Issue