Class StreamHelper
Represents the stream helper.
Inheritance
Namespace: Syncfusion.CompoundFile.XlsIO.Net
Assembly: Syncfusion.XlsIO.Portable.dll
Syntax
public static class StreamHelper : Object
Fields
IntSize
Size of the Int32 in bytes.
Declaration
public const int IntSize = 4
Field Value
Type |
---|
System.Int32 |
Methods
AddPadding(Stream, ref Int32)
Adds padding if necessary.
Declaration
public static void AddPadding(Stream stream, ref int iWrittenSize)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Int32 | iWrittenSize |
GetAsciiString(Stream, Int32)
Gets ASCII string from the stream starting from the current position.
Declaration
public static string GetAsciiString(Stream stream, int roundedSize)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Int32 | roundedSize | Approximate string size. |
Returns
Type | Description |
---|---|
System.String | Extracted string. |
GetUnicodeString(Stream, Int32)
Extracts unicode string from the stream.
Declaration
public static string GetUnicodeString(Stream stream, int roundedSize)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Int32 | roundedSize |
Returns
Type |
---|
System.String |
ReadDouble(Stream, Byte[])
Reads Double value from the stream.
Declaration
public static double ReadDouble(Stream stream, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Byte[] | buffer | Temporary buffer to put extracted bytes into. |
Returns
Type | Description |
---|---|
System.Double | Extracted Double value. |
ReadInt16(Stream, Byte[])
Reads Int16 value from the stream.
Declaration
public static short ReadInt16(Stream stream, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Byte[] | buffer | Temporary buffer to put extracted bytes into. |
Returns
Type | Description |
---|---|
System.Int16 | Extracted Int32 value. |
ReadInt32(Stream, Byte[])
Reads Int32 value from the stream.
Declaration
public static int ReadInt32(Stream stream, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Byte[] | buffer | Temporary buffer to put extracted bytes into. |
Returns
Type | Description |
---|---|
System.Int32 | Extracted Int32 value. |
WriteAsciiString(Stream, String, Boolean)
Gets ASCII string from the stream starting from the current position.
Declaration
public static int WriteAsciiString(Stream stream, string value, bool align)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.String | value | |
System.Boolean | align |
Returns
Type | Description |
---|---|
System.Int32 | Extracted string. |
WriteDouble(Stream, Double)
Reads Double value from the stream.
Declaration
public static int WriteDouble(Stream stream, double value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Double | value |
Returns
Type | Description |
---|---|
System.Int32 | Extracted Double value. |
WriteInt16(Stream, Int16)
Writes Int16 value from the stream.
Declaration
public static int WriteInt16(Stream stream, short value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to get data from. |
System.Int16 | value | Value to write. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data. |
WriteInt32(Stream, Int32)
Writes Int32 value from the stream.
Declaration
public static int WriteInt32(Stream stream, int value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to write data into. |
System.Int32 | value | Value to write. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data. |
WriteString(Stream, String, Encoding, Boolean)
Writes string into stream using specified encoding.
Declaration
public static int WriteString(Stream stream, string value, Encoding encoding, bool align)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to write data into. |
System.String | value | Value to write. |
System.Text.Encoding | encoding | Encoding to use. |
System.Boolean | align |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data in bytes. |
WriteUnicodeString(Stream, String)
Writes unicode string into steram.
Declaration
public static int WriteUnicodeString(Stream stream, string value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to write data into. |
System.String | value | Value to write. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data in bytes. |