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