Exemple #1
0
        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);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public static byte[] ReadBytesToEnd(this HazelBinaryReader binRdr)
 {
     return(binRdr.ReadBytes((int)binRdr.GetBytesLeft()));
 }