if (isClosed()) throw new SocketException("socket is closed");
  public int getSendBufferSize () throws SocketException  {    Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);    if (buf instanceof Integer)      return(((Integer)buf).intValue());    else      throw new SocketException("Internal Error: Unexpected type");  }