Ejemplo n.º 1
0
 public static ChunkCompressedInfo FromBinary(
     byte[] buffer,
     int offset)
 {
     return(new ChunkCompressedInfo(
                BitConverter.ToInt32(buffer, offset),
                ChunkInfo.FromBinary(buffer, offset + 4)));
 }
Ejemplo n.º 2
0
 public static ChunkDecompressionInfo FromBinary(
     byte[] buffer,
     int offset)
 {
     return(new ChunkDecompressionInfo(
                ChunkInfo.FromBinary(buffer, offset),
                ChunkInfo.FromBinary(buffer, offset + ChunkInfo.SIZE)));
 }
Ejemplo n.º 3
0
        public void ShouldSerializeDeserialize(long offset, int size)
        {
            var chunk  = new ChunkInfo(offset, size);
            var buffer = new byte[ChunkInfo.SIZE];

            ChunkInfo.ToBinary(chunk, buffer, 0);
            var result = ChunkInfo.FromBinary(buffer, 0);

            Assert.Equal(offset, result.offset);
            Assert.Equal(size, result.size);
        }