Class ExtensionMethods
Inheritance
System.Object
ExtensionMethods
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.IO
Assembly: Mars.IO.dll
Syntax
public static class ExtensionMethods
Methods
| Improve this Doc View SourceGetPosition(StreamReader)
Gets the underlying buffer position for a StreamReader.
Declaration
public static long GetPosition(this StreamReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.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 | |
System.Text.Encoding | encoding |
Returns
Type | Description |
---|---|
System.IO.Stream |