Class ExtensionMethods
Inheritance
System.Object
ExtensionMethods
Namespace: Mars.Common.IO
Assembly: Mars.IO.dll
Syntax
public static class ExtensionMethods : object
Methods
GetPosition(StreamReader)
Gets the underlying buffer position for a StreamReader.
Declaration
public static long GetPosition(this StreamReader reader)
Parameters
Type | Name | Description |
---|---|---|
StreamReader | reader | A StreamReader whose position will be retrieved. |
Returns
Type | Description |
---|---|
System.Int64 | The current offset from the beginning of the file that the StreamReader is currently located into. |
ToStream(String, Encoding)
Reads an
input
content string to stream form.
Declaration
public static Stream ToStream(this string input, Encoding encoding = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | |
Encoding | encoding |
Returns
Type | Description |
---|---|
Stream |