/** * Same as getOutputStream(socket, 0). Timeout of zero implies write will * wait until data is available.<br> * <br> * From documentation for {@link #getOutputStream(Socket, long)} : <br> * Returns OutputStream for the socket. If the socket has an associated * SocketChannel then it returns a {@link SocketOutputStream} with the given timeout. If the socket does not * have a channel, {@link Socket#getOutputStream()} is returned. In the later * case, the timeout argument is ignored and the write will wait until * data is available.<br> * <br> * Any socket created using socket factories returned by {@link #NetUtils}, * must use this interface instead of {@link Socket#getOutputStream()}. * * @see #getOutputStream(Socket, long) * @param socket * @return OutputStream for writing to the socket. * @throws IOException */ public static OutputStream getOutputStream(Socket socket) throws IOException { return getOutputStream(socket, 0); }
/** * Same as getOutputStream(socket, 0). Timeout of zero implies write will * wait until data is available.<br> * <br> * From documentation for {@link #getOutputStream(Socket, long)} : <br> * Returns OutputStream for the socket. If the socket has an associated * SocketChannel then it returns a {@link SocketOutputStream} with the given timeout. If the socket does not * have a channel, {@link Socket#getOutputStream()} is returned. In the later * case, the timeout argument is ignored and the write will wait until * data is available.<br> * <br> * Any socket created using socket factories returned by {@link #NetUtils}, * must use this interface instead of {@link Socket#getOutputStream()}. * * @see #getOutputStream(Socket, long) * @param socket * @return OutputStream for writing to the socket. * @throws IOException */ public static OutputStream getOutputStream(Socket socket) throws IOException { return getOutputStream(socket, 0); }
this.out = new DataOutputStream(new BufferedOutputStream(NetUtils.getOutputStream(socket))); writeHeader();
this.out = new DataOutputStream(new BufferedOutputStream(NetUtils.getOutputStream(socket))); writeHeader();