Here you can find the source of getInputStreamFromSocket(final Socket socket)
Parameter | Description |
---|---|
socket | the socket the inputstream is connected to. |
Parameter | Description |
---|---|
IOException | if a error occurs while connecting to the server. |
public static InputStream getInputStreamFromSocket(final Socket socket) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Joe Beeton./*w ww . j a va2 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.InputStream; import java.net.Socket; public class Main { /** * Returns a InputStream from the specified socket * @param socket the socket the inputstream is connected to. * @return the input stream connected to the specified socket. * @throws IOException if a error occurs while connecting to the server. */ public static InputStream getInputStreamFromSocket(final Socket socket) throws IOException { return socket.getInputStream(); } }