com.act365.net
Class GeneralSocketInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--com.act365.net.GeneralSocketInputStream
- public class GeneralSocketInputStream
- extends java.io.InputStream
GeneralSocketInputStream
reads from a TCP socket.
The class should be used in conjunction with GeneralSocketImpl
.
- See Also:
GeneralSocketImpl
Constructor Summary |
GeneralSocketInputStream(int socketDescriptor)
Creates an input stream to read from the TCP socket with the given descriptor. |
Method Summary |
void |
close()
Closes the input stream. |
int |
read()
Reads a single character from the TCP stream. |
int |
read(byte[] buffer)
Reads a string of characters from the TCP stream into a buffer. |
int |
read(byte[] buffer,
int offset,
int count)
Reads a string of characters from the TCP stream into a given
location in a buffer. |
Methods inherited from class java.io.InputStream |
available, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GeneralSocketInputStream
public GeneralSocketInputStream(int socketDescriptor)
- Creates an input stream to read from the TCP socket with the given descriptor.
- Parameters:
socketDescriptor
- socket file descriptor
read
public int read()
throws java.io.IOException
- Reads a single character from the TCP stream.
- Overrides:
read
in class java.io.InputStream
read
public int read(byte[] buffer)
throws java.io.IOException
- Reads a string of characters from the TCP stream into a buffer.
- Overrides:
read
in class java.io.InputStream
- Parameters:
buffer
- the buffer the characters are to be written into
read
public int read(byte[] buffer,
int offset,
int count)
throws java.io.IOException
- Reads a string of characters from the TCP stream into a given
location in a buffer.
- Overrides:
read
in class java.io.InputStream
- Parameters:
buffer
- the buffer the characters are to be read intooffset
- the array location where the input is to be writtencount
- the number of characters to be read
close
public void close()
throws java.io.IOException
- Closes the input stream.
- Overrides:
close
in class java.io.InputStream