code: private int drain(byte[] b, int off, int len) {
      int remaining = Math.min(len, byteBuffer.remaining());
      byteBuffer.get(b, off, remaining);
      return remaining;
    }
docs: Copy as much of the byte buffer into the output array as possible, returning the (positive)
  number of characters copied.