コード例 #1
0
        public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
        {
            // When messages are passed over the wire, the data is serialised here then deserialised on the other end and then the response
            // is serialised and returned and deserialised here. That means that the "buffer" reference that is populated on the other end
            // is not the same as the reference here - so we need to overwrite the input buffer with the data from the response message.
            ThrowIfDisposed();
            var result            = _reader.GetBytes(_readerId, i, fieldOffset, buffer, bufferoffset, length);
            var numberOfBytesRead = result.Item1;
            var bytesRead         = result.Item2;

            Array.Copy(bytesRead, buffer, numberOfBytesRead);
            return(numberOfBytesRead);
        }