GZipStream does have a CopyTo()
parent
eb93855d84
commit
54eb6fc779
|
@ -163,19 +163,19 @@ namespace OpenSim.Data.MySQL
|
|||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using(GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data),
|
||||
CompressionMode.Decompress))
|
||||
using(MemoryStream ms = new MemoryStream(asset.Data))
|
||||
using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
|
||||
{
|
||||
using(MemoryStream outputStream = new MemoryStream())
|
||||
{
|
||||
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
||||
decompressionStream.CopyTo(outputStream, int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
asset.Data = outputStream.ToArray();
|
||||
}
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateAccessTime(asset.Metadata, (int)dbReader["AccessTime"]);
|
||||
|
|
|
@ -173,18 +173,18 @@ namespace OpenSim.Data.PGSQL
|
|||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using (GZipStream decompressionStream = new GZipStream( new MemoryStream(asset.Data),
|
||||
CompressionMode.Decompress))
|
||||
using(MemoryStream ms = new MemoryStream(asset.Data))
|
||||
using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
|
||||
{
|
||||
using(MemoryStream outputStream = new MemoryStream())
|
||||
{
|
||||
WebUtil.CopyStream(decompressionStream,outputStream,int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
}
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
decompressionStream.CopyTo(outputStream,int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
}
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue