public final class SockOutputStream extends OutputStream
SockOutputStream is a outputstream based on socket. There will be a
big buffer in the socket, which is 1Mb in default, you can put all bytes into
this buffer easily, when it is full, it will flush the bytes into the socket.OutputStream,
SchoonerSockIO| Constructor and Description |
|---|
SockOutputStream(SchoonerSockIO sock)
Constructor with SockIO.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCount()
get byte count, how many wrote.
|
SchoonerSockIO |
getSock()
get channel of this stream.
|
void |
resetCount()
reset the count;
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
close, flushpublic SockOutputStream(SchoonerSockIO sock)
sock - specified socket for this outputstream.public final int getCount()
public final void resetCount()
public final SchoonerSockIO getSock()
public final void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic final void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic final void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2013 Schooner Information Technology. All Rights Reserved.