Class StreamConverterExtensions
This is an extension implementation of the StreamConverter class.
Inheritance
System.Object
StreamConverterExtensions
Namespace: Cuemon.IO
Assembly: Cuemon.IO.dll
Syntax
public static class StreamConverterExtensions
Methods
| Improve this DocRemovePreamble(Stream, Encoding)
Removes the preamble information (if present) from the specified System.IO.Stream, and source
is being closed and disposed.
Declaration
public static Stream RemovePreamble(this Stream source, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | source | The input System.IO.Stream to process. |
System.Text.Encoding | encoding | The encoding to use when determining the preamble to remove. |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream without preamble information. |
ToStream(Byte[])
Converts the specified value
to a System.IO.Stream.
Declaration
public static Stream ToStream(this byte[] value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | value | The byte array to be converted. |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream object. |
ToStream(String, Action<EncodingOptions>)
Converts the specified value
to a System.IO.Stream.
Declaration
public static Stream ToStream(this string value, Action<EncodingOptions> setup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to be converted. |
System.Action<EncodingOptions> | setup | The EncodingOptions which need to be configured. |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream object. |
Remarks
EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.