if (dst.hasArray()) { offset = dst.arrayOffset() + dst.position(); data = dst.array(); } else { data = new byte [len];
return channel.read(dst);
  public int read(ByteBuffer dst) throws IOException  {    if (!isConnected())      throw new NotYetConnectedException();	    byte[] data;    int offset = 0;    InputStream input = socket.getInputStream();    int available = input.available();    int len = dst.remaining();    if ((! isBlocking()) && available == 0)      return 0;        if (dst.hasArray())	    {        offset = dst.arrayOffset() + dst.position();        data = dst.array();	    }    else      {        data = new byte [len];  }        int readBytes = 0;    boolean completed = false;    try  {        begin();        socket.getPlainSocketImpl().setInChannelOperation(true);        readBytes = input.read (data, offset, len);        completed = true;      }    finally      {        end (completed);        socket.getPlainSocketImpl().setInChannelOperation(false);      }    if (readBytes > 0)      if (dst.hasArray())	    {	  dst.position (dst.position() + readBytes);	    }      else        {          dst.put (data, offset, readBytes);        }    return readBytes;  }