Here you can find the source of getOutputStreamFromSocket(final Socket socket)
Parameter | Description |
---|---|
socket | the socket the OutputStream is connected to. |
Parameter | Description |
---|---|
IOException | if a error occurs while connecting to the server. |
public static OutputStream getOutputStreamFromSocket(final Socket socket) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Joe Beeton./*from ww w . j ava 2 s. c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * * Contributors: * Joe Beeton - initial API and implementation ******************************************************************************/ import java.io.IOException; import java.io.OutputStream; import java.net.Socket; public class Main { /** * Returns a OutputStream from the specified socket * @param socket the socket the OutputStream is connected to. * @return the OutputStream connected to the specified socket. * @throws IOException if a error occurs while connecting to the server. */ public static OutputStream getOutputStreamFromSocket(final Socket socket) throws IOException { return socket.getOutputStream(); } }