public static void Write(this Stream stream, short value, bool bigEndian = false) { WriteBytes(stream, BinaryHelper.Int16ToBytes(value, bigEndian)); }
public static void Write(this Stream stream, uint value, bool bigEndian = false) { WriteBytes(stream, BinaryHelper.UInt32ToBytes(value, bigEndian)); }
public static ushort PeekUint16(this Stream stream, bool bigEndian = false) { return(BinaryHelper.ByteToUInt16(PeekBytes(stream, 2), bigEndian)); }
public static uint ReadUint32(this Stream stream, bool bigEndian = false) { return(BinaryHelper.ByteToUInt32(ReadBytes(stream, 4), bigEndian)); }
public static short ReadInt16(this Stream stream, bool bigEndian = false) { return(BinaryHelper.ByteToInt16(ReadBytes(stream, 2), bigEndian)); }
// // // STREAM EXTENSIONS // // public static string ReadUTF8Sring(this Stream stream, int numBytes) { byte[] bytes = ReadBytes(stream, numBytes); return(BinaryHelper.ConvertByteArrayToUTF8String(bytes)); }