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