Пример #1
0
        public byte[] GetDataBytes(BinaryAddress address)
        {
            var result = new byte[address.Len];

            _memoryStream.Position = _initialPosition + address.Ptr;
            _memoryStream.Read(result, 0, (int)address.Len);
            return(result);
        }
Пример #2
0
        public BinaryAddress AddData(MemoryStream binaryStream, Type type, int[][] structure)
        {
            BinaryAddress address = new BinaryAddress {
                Ptr = _memoryStream.Position - _initialPosition, Len = binaryStream.Length, Structure = structure
            };

            if (structure != null)
            {
                address.Type = type;
            }
            binaryStream.WriteTo(_memoryStream);
            return(address);
        }
Пример #3
0
 public MemoryStream GetData(BinaryAddress address)
 {
     return(new MemoryStream(GetDataBytes(address)));
 }