Пример #1
0
        public static Guid ReadUuidProto(this PrimitiveReader reader)
        {
            var buf = new byte[16];

            reader.ReadFully(buf, 0, 16);
            Array.Reverse(buf);
            return(new Guid(buf));
        }
Пример #2
0
            internal override void Read(PrimitiveReader reader, int _)
            {
                var len = reader.ReadInt();

                if (len < 0)
                {
                    throw new NBTException("Negative length.");
                }
                Value = new byte[len];
                reader.ReadFully(Value, 0, Value.Length);
            }
Пример #3
0
 public override void Read(PrimitiveReader reader)
 {
     Channel = reader.ReadStringProto(20);
     Data    = new byte[reader.BaseStream.Length];
     reader.ReadFully(Data, 0, Data.Length);
 }