BitSharper.Store.BoundedOverheadBlockStore.Record.Read C# (CSharp) Method

Read() public method

public Read ( Stream channel, long position, ByteBuffer buffer ) : bool
channel System.IO.Stream
position long
buffer BitSharper.IO.ByteBuffer
return bool
            public bool Read(Stream channel, long position, ByteBuffer buffer)
            {
                buffer.Position = 0;
                var originalPos = channel.Position;
                channel.Position = position;
                var data = new byte[buffer.Length];
                var bytesRead = channel.Read(data);
                buffer.Clear();
                buffer.Write(data);
                channel.Position = originalPos;
                if (bytesRead < Size)
                    return false;
                buffer.Position = 0;
                _height = (uint) buffer.GetInt();
                buffer.Get(_chainWork);
                buffer.Get(_blockHeader);
                return true;
            }