/** * Returns the value of a socket option from a {@link java.net.Socket} * * @param s the socket * @param name The socket option * @return The value of the socket option. * @throws UnsupportedOperationException if the socket does not support the option. * @throws IOException if an I/O error occurs * @throws SecurityException if a security manager is set and the caller does not have any * required permission. * @throws NullPointerException if name is null * @see java.net.StandardSocketOptions */ public static <T> T getOption(Socket s, SocketOption<T> name) throws IOException { return s.getOption(name); }