public class SocketInputStream extends FilterInputStream
in| Constructor and Description |
|---|
SocketInputStream(Socket socket,
InputStream inputstream)
Creates a socket input stream instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
int |
read()
Reads the next byte of data from this input stream.
|
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from this input stream into an array of bytes. |
available, mark, markSupported, read, reset, skippublic SocketInputStream(Socket socket, InputStream inputstream) throws IOException
socket - the socket.inputstream - the underlying input stream.IOException - if an error occurs.public void close()
throws IOException
FilterInputStreamin.close().close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOException - if an I/O error occurs.FilterInputStream.inpublic int read()
throws IOException
FilterInputStreamint in the range 0 to 255. If no byte is available because
the end of the stream has been reached, the value -1 is returned. This method blocks
until input data is available, the end of the stream is detected, or an exception is thrown.
This method simply performs in.read() and returns the result.
read in class FilterInputStream-1 if the end of the stream is reached.IOException - if an I/O error occurs.FilterInputStream.inpublic int read(byte[] b,
int off,
int len)
throws IOException
FilterInputStreamlen bytes of data from this input stream into an array of bytes. If
len is not zero, the method blocks until some input is available; otherwise, no
bytes are read and 0 is returned.
This method simply performs in.read(b, off, len) and returns the result.
read in class FilterInputStreamb - the buffer into which the data is read.off - the start offset in the destination array blen - the maximum number of bytes read.-1 if there is no more
data because the end of the stream has been reached.IOException - if an I/O error occurs.FilterInputStream.in