Skip to main content

StreamExt

Assembly: ServiceStack.Client.dll
View Source
Declaration
public static class StreamExt

Methods

Compress(String, String, Encoding)

Compresses the specified text using the default compression method: Deflate

View Source
Declaration
public static byte[] Compress(this string text, string compressionType, Encoding encoding = null)
Returns

System.Byte[]

Parameters
TypeNameDescription
System.StringtextThe text.

| | System.String | compressionType | Type of the compression.

| | System.Text.Encoding | encoding |

|

CompressStream(Stream, String)

View Source
Declaration
public static Stream CompressStream(this Stream stream, string compressionType)
Returns

System.IO.Stream

Parameters
TypeName
System.IO.Streamstream
System.StringcompressionType

CompressBytes(Byte[], String)

Compresses the specified text using the default compression method: Deflate

View Source
Declaration
public static byte[] CompressBytes(this byte[] bytes, string compressionType)
Returns

System.Byte[]

Parameters
TypeName
System.Byte[]bytes
System.StringcompressionType

Decompress(Byte[], String)

Decompresses the specified gz buffer using the default compression method: Inflate

View Source
Declaration
public static string Decompress(this byte[] gzBuffer, string compressionType)
Returns

System.String

Parameters
TypeNameDescription
System.Byte[]gzBufferThe gz buffer.

| | System.String | compressionType | Type of the compression.

|

Decompress(Stream, String)

Decompresses the specified gz buffer using inflate or gzip method

View Source
Declaration
public static Stream Decompress(this Stream gzStream, string compressionType)
Returns

System.IO.Stream: Decompressed stream

Parameters
TypeNameDescription
System.IO.StreamgzStreamCompressed 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
Declaration
public static byte[] DecompressBytes(this byte[] gzBuffer, string compressionType)
Returns

System.Byte[]

Parameters
TypeName
System.Byte[]gzBuffer
System.StringcompressionType

Deflate(String)

View Source
Declaration
public static byte[] Deflate(this string text)
Returns

System.Byte[]

Parameters
TypeName
System.Stringtext

Inflate(Byte[])

View Source
Declaration
public static string Inflate(this byte[] gzBuffer)
Returns

System.String

Parameters
TypeName
System.Byte[]gzBuffer

GZip(String)

View Source
Declaration
public static byte[] GZip(this string text)
Returns

System.Byte[]

Parameters
TypeName
System.Stringtext

GUnzip(Byte[])

View Source
Declaration
public static string GUnzip(this byte[] gzBuffer)
Returns

System.String

Parameters
TypeName
System.Byte[]gzBuffer

ToUtf8String(Stream)

View Source
Declaration
public static string ToUtf8String(this Stream stream)
Returns

System.String

Parameters
TypeName
System.IO.Streamstream

ToBytes(Stream)

View Source
Declaration
public static byte[] ToBytes(this Stream stream)
Returns

System.Byte[]

Parameters
TypeName
System.IO.Streamstream

Write(Stream, String)

View Source
Declaration
public static void Write(this Stream stream, string text)
Parameters
TypeName
System.IO.Streamstream
System.Stringtext