public class SocketInputStream
extends java.io.FilterInputStream
SocketOutputStream
构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
close
在类中 java.io.FilterInputStream
java.io.IOException
- If there is an error in closing the stream
or socket.