Example #1
0
        private T Read <T>(IBinaryInformation <T> info)
        {
            var data = new byte[info.FixedLength];

            _stream.Read(data, 0, data.Length);
            return(info.Converter.Convert(data));
        }
Example #2
0
        private void Write <T>(IBinaryInformation <T> info, T value)
        {
            var bytes = info.Converter.Convert(value);

            _writeBuffer.Write(bytes, 0, bytes.Length);
        }