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/MySQL | |
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/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLXAssetData.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index 23f6837..e519a94 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs | |||
@@ -163,19 +163,19 @@ namespace OpenSim.Data.MySQL | |||
163 | 163 | ||
164 | if (m_enableCompression) | 164 | if (m_enableCompression) |
165 | { | 165 | { |
166 | using(GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), | 166 | using(MemoryStream ms = new MemoryStream(asset.Data)) |
167 | CompressionMode.Decompress)) | 167 | using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress)) |
168 | { | 168 | { |
169 | using(MemoryStream outputStream = new MemoryStream()) | 169 | using(MemoryStream outputStream = new MemoryStream()) |
170 | { | 170 | { |
171 | WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue); | 171 | decompressionStream.CopyTo(outputStream, int.MaxValue); |
172 | // int compressedLength = asset.Data.Length; | 172 | // int compressedLength = asset.Data.Length; |
173 | asset.Data = outputStream.ToArray(); | 173 | asset.Data = outputStream.ToArray(); |
174 | } | 174 | } |
175 | // m_log.DebugFormat( | 175 | // m_log.DebugFormat( |
176 | // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", | 176 | // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", |
177 | // asset.ID, asset.Name, asset.Data.Length, compressedLength); | 177 | // asset.ID, asset.Name, asset.Data.Length, compressedLength); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | UpdateAccessTime(asset.Metadata, (int)dbReader["AccessTime"]); | 181 | UpdateAccessTime(asset.Metadata, (int)dbReader["AccessTime"]); |