java.io.Closeable
, java.lang.AutoCloseable
public class SocketInputStream
extends java.io.FilterInputStream
SocketOutputStream
Constructor | Description |
---|---|
SocketInputStream(java.net.Socket socket,
java.io.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 | Description |
---|---|---|
void |
close() |
Closes the stream and immediately afterward closes the referenced
socket.
|
public SocketInputStream(java.net.Socket socket, java.io.InputStream stream)
socket
- The socket to close on closing the stream.stream
- The input stream to wrap.public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
- If there is an error in closing the stream
or socket.Copyright © 1997-2002 Daniel F. Savarese. All Rights Reserved.