diff options
author | UbitUmarov | 2017-05-06 18:25:07 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-06 18:25:07 +0100 |
commit | 54eb6fc779c578e28ea4f5a17aebb956838ab14d (patch) | |
tree | 221a368b621677bdac45e5b97553fd5039eda783 /OpenSim/Data/PGSQL | |
parent | dispose some MemoryStreams (diff) | |
download | opensim-SC_OLD-54eb6fc779c578e28ea4f5a17aebb956838ab14d.zip opensim-SC_OLD-54eb6fc779c578e28ea4f5a17aebb956838ab14d.tar.gz opensim-SC_OLD-54eb6fc779c578e28ea4f5a17aebb956838ab14d.tar.bz2 opensim-SC_OLD-54eb6fc779c578e28ea4f5a17aebb956838ab14d.tar.xz |
GZipStream does have a CopyTo()
Diffstat (limited to 'OpenSim/Data/PGSQL')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLXAssetData.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs index 000a446..1798d20 100644 --- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs +++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs | |||
@@ -173,18 +173,18 @@ namespace OpenSim.Data.PGSQL | |||
173 | 173 | ||
174 | if (m_enableCompression) | 174 | if (m_enableCompression) |
175 | { | 175 | { |
176 | using (GZipStream decompressionStream = new GZipStream( new MemoryStream(asset.Data), | 176 | using(MemoryStream ms = new MemoryStream(asset.Data)) |
177 | CompressionMode.Decompress)) | 177 | using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress)) |
178 | { | 178 | { |
179 | using(MemoryStream outputStream = new MemoryStream()) | 179 | using(MemoryStream outputStream = new MemoryStream()) |
180 | { | 180 | { |
181 | WebUtil.CopyStream(decompressionStream,outputStream,int.MaxValue); | 181 | decompressionStream.CopyTo(outputStream,int.MaxValue); |
182 | // int compressedLength = asset.Data.Length; | 182 | // int compressedLength = asset.Data.Length; |
183 | asset.Data = outputStream.ToArray(); | 183 | asset.Data = outputStream.ToArray(); |
184 | } | 184 | } |
185 | // m_log.DebugFormat( | 185 | // m_log.DebugFormat( |
186 | // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", | 186 | // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", |
187 | // asset.ID, asset.Name, asset.Data.Length, compressedLength); | 187 | // asset.ID, asset.Name, asset.Data.Length, compressedLength); |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||