CqlSharp.Protocol.FrameReader.ReadBytesAsync C# (CSharp) Méthode

ReadBytesAsync() public méthode

Reads the bytes async.
public ReadBytesAsync ( ) : Task
Résultat Task
        public async Task<byte[]> ReadBytesAsync()
        {
            int len = await ReadIntAsync().AutoConfigureAwait();
            if(-1 == len)
                return null;

            //read the string segment
            if(!TryGetSegmentFromBuffer(len))
                await ReadSegmentAsync(len).AutoConfigureAwait();

            //copy data from buffer into new array if necessary
            byte[] data = _lastReadSegment.Array == _buffer ? CopySegmentToArray() : _lastReadSegment.Array;

            return data;
        }