StreamExt
Assembly: ServiceStack.Client.dll
View Source
public static class StreamExt
Methods
Compress(String, String, Encoding)
Compresses the specified text using the default compression method: Deflate
View Source
public static byte[] Compress(this string text, string compressionType, Encoding encoding = null)
Returns
System.Byte[]
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text. |
|
| System.String
| compressionType | Type of the compression.
|
| System.Text.Encoding
| encoding |
|
CompressStream(Stream, String)
View Source
public static Stream CompressStream(this Stream stream, string compressionType)
Returns
System.IO.Stream
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
System.String | compressionType |
CompressBytes(Byte[], String)
Compresses the specified text using the default compression method: Deflate
View Source
public static byte[] CompressBytes(this byte[] bytes, string compressionType)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.Byte[] | bytes |
System.String | compressionType |
Decompress(Byte[], String)
Decompresses the specified gz buffer using the default compression method: Inflate
View Source
public static string Decompress(this byte[] gzBuffer, string compressionType)
Returns
System.String
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | gzBuffer | The gz buffer. |
|
| System.String
| compressionType | Type of the compression.
|
Decompress(Stream, String)
Decompresses the specified gz buffer using inflate or gzip method
View Source
public static Stream Decompress(this Stream gzStream, string compressionType)
Returns
System.IO.Stream
: Decompressed stream
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | gzStream | Compressed stream |
|
| System.String
| compressionType | Type of the compression. Can be "gzip" or "deflate"
|
DecompressBytes(Byte[], String)
Decompresses the specified gz buffer using the default compression method: Inflate
View Source
public static byte[] DecompressBytes(this byte[] gzBuffer, string compressionType)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.Byte[] | gzBuffer |
System.String | compressionType |
Deflate(String)
View Source
public static byte[] Deflate(this string text)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.String | text |
Inflate(Byte[])
View Source
public static string Inflate(this byte[] gzBuffer)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Byte[] | gzBuffer |
GZip(String)
View Source
public static byte[] GZip(this string text)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.String | text |
GUnzip(Byte[])
View Source
public static string GUnzip(this byte[] gzBuffer)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Byte[] | gzBuffer |
ToUtf8String(Stream)
View Source
public static string ToUtf8String(this Stream stream)
Returns
System.String
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
ToBytes(Stream)
View Source
public static byte[] ToBytes(this Stream stream)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
Write(Stream, String)
View Source
public static void Write(this Stream stream, string text)
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
System.String | text |