Public Member Functions | |
BitStreamWriter () | |
Creates a BitStreamWriter using the default sub-storage block size of 4096 bytes. This constructor is meant for general purpose usage but may be less efficient than the secondary constructor which allows the sub-storage block size to be user-defined, allowing for larger blocks more suited for efficient storage with larger data storage requirements. | |
BitStreamWriter (int _block_size) | |
Createa a BitStreamWriter object with a user-defined sub-block storage size (in bytes) Larger sub-blocks will make the storage routines more efficient whilst small sub-blocks are suitable for compact data management where memory is limited. The default constructor uses a sub-block size of 4096 bytes. | |
void | write (byte _value, int _req_bits) |
Writes a byte value to the BitStreamWriter storage, fitting it into the required number of bits. If the value is too large to fit into the required number of bits or the required bit-length is less than 1 or greater that 8 then a BitRequirementException is thrown. | |
void | writeBytes (byte[] _bytes) |
Writes an array of bytes to storage using the default bit length of 8-bits per byte. | |
void | write (char _value) |
Writes a char value to storage. | |
void | write (short _value) |
Writes an chort value to storage. | |
void | write (ushort _value) |
Writes an unsigned short value to storage. | |
void | write (int _value) |
Writes an integer value to storage. | |
void | write (uint _value) |
Writes an unsigned integer value to storage. | |
void | write (float _value) |
Writes a float value to storage. | |
void | write (double _value) |
Writes a double precision float value to storage. | |
void | write (string _value) |
Writes a string to storage. Note that the string is stored as an array of char values, not bytes. | |
byte[] | getBytes () |
Returns the stored values as a byte array. | |
void | saveToFile (string _filename) |
Saves the stored data directly to file. If the filename given points to an inaccessible storage location an exception will be thrown. | |
Static Public Member Functions | |
static int | getBitCount (byte _value) |
Utility method: Returns the minimum number of bits required to store a byte value. | |
Static Public Attributes | |
static readonly byte[] | max_bit_values |
Utility membe: Defines an array of values representing the maximum value storable in a particular bit length. |
UK_CO_MEVANSPN_libBitStream.BitStreamWriter.BitStreamWriter | ( | ) |
Creates a BitStreamWriter using the default sub-storage block size of 4096 bytes. This constructor is meant for general purpose usage but may be less efficient than the secondary constructor which allows the sub-storage block size to be user-defined, allowing for larger blocks more suited for efficient storage with larger data storage requirements.
UK_CO_MEVANSPN_libBitStream.BitStreamWriter.BitStreamWriter | ( | int | _block_size | ) |
Createa a BitStreamWriter object with a user-defined sub-block storage size (in bytes) Larger sub-blocks will make the storage routines more efficient whilst small sub-blocks are suitable for compact data management where memory is limited. The default constructor uses a sub-block size of 4096 bytes.
_block_size | Size of the sub-block storage in bytes. A System.Int32 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | byte | _value, | |
int | _req_bits | |||
) |
Writes a byte value to the BitStreamWriter storage, fitting it into the required number of bits. If the value is too large to fit into the required number of bits or the required bit-length is less than 1 or greater that 8 then a BitRequirementException is thrown.
_value | The value to write to storage. A System.Byte |
_req_bits | A System.Int32 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.writeBytes | ( | byte[] | _bytes | ) |
Writes an array of bytes to storage using the default bit length of 8-bits per byte.
_bytes | The byte array to write to storage. A System.Byte |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | char | _value | ) |
Writes a char value to storage.
_value | Char value to write. A System.Char |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | short | _value | ) |
Writes an chort value to storage.
_value | Short value to write. A System.Int16 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | ushort | _value | ) |
Writes an unsigned short value to storage.
_value | Value to write. A System.UInt16 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | int | _value | ) |
Writes an integer value to storage.
_value | Value to write. A System.Int32 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | uint | _value | ) |
Writes an unsigned integer value to storage.
_value | Value to write. A System.UInt32 |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | float | _value | ) |
Writes a float value to storage.
_value | Write to write. A System.Single |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | double | _value | ) |
Writes a double precision float value to storage.
_value | Value to write. A System.Double |
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.write | ( | string | _value | ) |
Writes a string to storage. Note that the string is stored as an array of char values, not bytes.
_value | String to write. A System.String |
byte [] UK_CO_MEVANSPN_libBitStream.BitStreamWriter.getBytes | ( | ) |
Returns the stored values as a byte array.
void UK_CO_MEVANSPN_libBitStream.BitStreamWriter.saveToFile | ( | string | _filename | ) |
Saves the stored data directly to file. If the filename given points to an inaccessible storage location an exception will be thrown.
_filename | Filename (including optional path) used to store this data. A System.String |
static int UK_CO_MEVANSPN_libBitStream.BitStreamWriter.getBitCount | ( | byte | _value | ) | [static] |
Utility method: Returns the minimum number of bits required to store a byte value.
_value | Value to store. A System.Byte |
readonly byte [] UK_CO_MEVANSPN_libBitStream.BitStreamWriter.max_bit_values [static] |
Utility membe: Defines an array of values representing the maximum value storable in a particular bit length.