code: @Override
      public int read(ByteBuffer dst)
              throws IOException
      {
  
          if (dst == null) {
              throw new IllegalArgumentException("dst is null");
          }
  
          if (closed) {
              throw new ClosedChannelException();
          }
  
          if (dst.remaining() == 0) {
              return 0;
          }
          if (!ensureBuffer()) {
              return -1;
          }
  
          final int size = min(dst.remaining(), available());
          dst.put(buffer, position, size);
          position += size;
          return size;
      }
docs: {@inheritDoc}