com.act365.net
Class GeneralSocketOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--com.act365.net.GeneralSocketOutputStream
- public class GeneralSocketOutputStream
- extends java.io.OutputStream
GeneralSocketOutputStream
writes to a TCP socket.
The class should be used in conjunction with GeneralSocketImpl
.
- See Also:
GeneralSocketImpl
Constructor Summary |
GeneralSocketOutputStream(int socketDescriptor)
Creates an output stream to write to the TCP socket with the given descriptor. |
Method Summary |
void |
close()
Closes the output stream. |
void |
write(byte[] buffer)
Writes a string of characters into the TCP stream from a buffer. |
void |
write(byte[] buffer,
int offset,
int count)
Writes a string of characters into the TCP stream from a given
location in a buffer. |
void |
write(int oneByte)
Writes a single character to the TCP stream. |
Methods inherited from class java.io.OutputStream |
flush |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GeneralSocketOutputStream
public GeneralSocketOutputStream(int socketDescriptor)
- Creates an output stream to write to the TCP socket with the given descriptor.
- Parameters:
socketDescriptor
- socket file descriptor
write
public void write(int oneByte)
throws java.io.IOException
- Writes a single character to the TCP stream.
- Overrides:
write
in class java.io.OutputStream
write
public void write(byte[] buffer)
throws java.io.IOException
- Writes a string of characters into the TCP stream from a buffer.
- Overrides:
write
in class java.io.OutputStream
- Parameters:
buffer
- the buffer the characters are to be read from
write
public void write(byte[] buffer,
int offset,
int count)
throws java.io.IOException
- Writes a string of characters into the TCP stream from a given
location in a buffer.
- Overrides:
write
in class java.io.OutputStream
- Parameters:
buffer
- the buffer the characters are to be read fromoffset
- the array location from where the input is to be readcount
- the number of characters to be read
close
public void close()
throws java.io.IOException
- Closes the output stream.
- Overrides:
close
in class java.io.OutputStream