请注意,这个模块是处理http请求或者响应之中的gzip压缩的数据, 对于zip压缩的数据需要使用ZipStreamExtensions模块之中的帮助函数来完成
GZipStreamHandler
01 Syntax
Microsoft.VisualBasic.Net.Http.GZipStreamHandler
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| AddGzipMagic | 1 | 如果得到的一个gzip压缩的数据块头部没有magic number的话,则使用这个方法手动的添加标记后再做解压缩 |
| UnGzipBase64 | 1 | Unzip the stream data in the base64 string. |
| UnGzipStream | 2 | 将输入的流数据进行gzip解压缩 |
| GZipStream | 1 | 对所输入的流进行gzip压缩 |
| GZipAsBase64 | 2 | |
| CheckGZipMagic | 1 |
03 Members
AddGzipMagic(
IEnumerable(Of Byte))如果得到的一个gzip压缩的数据块头部没有magic number的话,则使用这个方法手动的添加标记后再做解压缩
Parameters
| Name | Type | Description |
|---|---|---|
data | IEnumerable(Of Byte) | - |
Returns
返回来的数据的头部多了两个gzip压缩流的magic字节
UnGzipBase64(
String)Unzip the stream data in the base64 string.
Parameters
| Name | Type | Description |
|---|---|---|
base64$ | String | - |
UnGzipStream(
Stream)将输入的流数据进行gzip解压缩
Remarks
使用这个函数得到的结果需要注意进行IDisposable.Dispose(),否则很容易造成内存泄漏
Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | - |
Returns
a memory stream object that has file position reset to scan0
UnGzipStream(
IEnumerable(Of Byte))将输入的流数据进行gzip解压缩
Remarks
使用这个函数得到的结果需要注意进行IDisposable.Dispose(),否则很容易造成内存泄漏
Parameters
| Name | Type | Description |
|---|---|---|
stream | IEnumerable(Of Byte) | - |
GZipStream(
Stream, Boolean)对所输入的流进行gzip压缩
Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | - |
noMagic | Boolean | omit the gzip magic number? |
GZipAsBase64(
IEnumerable(Of Byte), Boolean)Parameters
| Name | Type | Description |
|---|---|---|
bytes | IEnumerable(Of Byte) | - |
noMagic | Boolean | omit the gzip magic number? |
GZipAsBase64(
Stream, Boolean)将目标流对象之中的数据进行zip压缩,然后转换为base64字符串
Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | - |
CheckGZipMagic(
Stream)