int len = dst.capacity() - dst.position();
int len = dst.remaining();
  public SocketAddress receive (ByteBuffer dst)    throws IOException  {    if (!isOpen())      throw new ClosedChannelException();        try      {        DatagramPacket packet;        int len = dst.capacity() - dst.position();                if (dst.hasArray())          {            packet = new DatagramPacket (dst.array(),                                         dst.arrayOffset() + dst.position(),                                         len);          }        else          {            packet = new DatagramPacket (new byte [len], len);  }            boolean completed = false;        try          {            begin();            setInChannelOperation(true);            socket.receive (packet);            completed = true;          }        finally  {            end (completed);            setInChannelOperation(false);  }            if (!dst.hasArray())          {            dst.put (packet.getData(), packet.getOffset(), packet.getLength());          }        else  {            dst.position (dst.position() + packet.getLength());  }            return packet.getSocketAddress();      }    catch (SocketTimeoutException e)  {    return null;  }  }