public static byte[] PeekBytes(this HazelBinaryReader binRdr, int count) { var pos = binRdr.BaseStream.Position; var bytes = binRdr.ReadBytes(count); binRdr.BaseStream.Position = pos; return(bytes); }
public static HazelBinaryReader ReadMessage(this HazelBinaryReader binRdr, out int type) { var size = binRdr.ReadUInt16(); type = binRdr.ReadByte(); var data = binRdr.ReadBytes(size); return(new HazelBinaryReader(data)); }
public static byte[] ReadBytesToEnd(this HazelBinaryReader binRdr) { return(binRdr.ReadBytes((int)binRdr.GetBytesLeft())); }