/// <summary> /// Sets the writer's endian to the one specified. /// <param name="endian">Endian to change to.</param> /// </summary> public void SetEndian(DhEndian endian) { Endian = endian; }
/// <summary> /// Init Binary Writer (UTF-8 Encoding) /// </summary> /// <param name="stream">The stream to write data to.</param> public DhBinaryWriter(Stream stream, DhEndian endian) { Writer = new BinaryWriter(stream, Encoding.UTF8); Endian = endian; Encoding = Encoding.UTF8; }
/// <summary> /// Init Binary Writer (Custom Encoding) /// </summary> /// <param name="stream">The stream to write data to.</param> public DhBinaryWriter(Stream stream, DhEndian endian, Encoding encoding) { Writer = new BinaryWriter(stream, encoding); Endian = endian; Encoding = encoding; }
/// <summary> /// Init Binary Reader. (UTF-8 Encoding) /// </summary> /// <param name="data">The data to read from.</param> public DhBinaryReader(byte[] data, DhEndian endian) { Reader = new BinaryReader(new MemoryStream(data), Encoding.UTF8); Endian = endian; Encoding = Encoding.UTF8; }