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