readIntoBuffer method

  1. @override
Future<int> readIntoBuffer(
  1. LByteBuffer buffer
)
override

Read the amount of remaining bytes of the buffer from the reader. returns the real count read.

Implementation

@override
Future<int> readIntoBuffer(LByteBuffer buffer) async {
  // List<int> read = [];
  int read = await channel.readInto(
      buffer._data, buffer._position, buffer._position + buffer.remaining);
  buffer._position = buffer._position + read;
  if (read <= 0) {
    return -1;
  }
  return read;
}