Class Utility
Contains utility functions.
Inheritance
System.Object
Utility
Namespace: ExifLibrary
Assembly: ExifLibrary.dll
Syntax
public class Utility
Methods
| Improve this Doc View SourceCompressString(String, Encoding)
Compresses the given string.
Declaration
public static byte[] CompressString(string text, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Input string. |
System.Text.Encoding | encoding | Text encoding. |
Returns
Type | Description |
---|---|
System.Byte[] | The compressed bytes. |
DecompressString(Byte[], Encoding)
Compresses the given bytes representing a string.
Declaration
public static string DecompressString(byte[] input, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | Input data. |
System.Text.Encoding | encoding | Text encoding. |
Returns
Type | Description |
---|---|
System.String | The decompressed string. |
GetStreamBytes(Stream)
Reads the entire stream and returns its contents as a byte array.
Declaration
public static byte[] GetStreamBytes(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream to read. |
Returns
Type | Description |
---|---|
System.Byte[] | Contents of the |
GetStreamBytes(Stream, Int64)
Reads the stream into the given byte array.
Declaration
public static byte[] GetStreamBytes(Stream stream, long length)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream to read. |
System.Int64 | length | The number of bytes to read. |
Returns
Type | Description |
---|---|
System.Byte[] | Contents of the |
SplitByteArray(Byte[], Byte)
Splits the given byte array at seperators.
Declaration
public static List<byte[]> SplitByteArray(byte[] data, byte seperator)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Input array. |
System.Byte | seperator | Separator byte. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte[]> | Sub arrays splitted at the separator. |