public class SocketInputStream extends FilterInputStream
SocketOutputStream
in
Constructor and Description |
---|
SocketInputStream(Socket socket,
InputStream stream)
Creates a SocketInputStream instance wrapping an input stream and
storing a reference to a socket that should be closed on closing
the stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream and immediately afterward closes the referenced
socket.
|
available, mark, markSupported, read, read, read, reset, skip
public SocketInputStream(Socket socket, InputStream stream)
socket
- The socket to close on closing the stream.stream
- The input stream to wrap.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterInputStream
IOException
- If there is an error in closing the stream
or socket.Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.