|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
com.schooner.MemCached.SockOutputStream
public final class SockOutputStream
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.
Don't make the buffer too much small, or else you will have problem in
memcached set operation.
OutputStream
,
SchoonerSockIO
Constructor Summary | |
---|---|
SockOutputStream(SchoonerSockIO sock)
Constructor with SockIO. |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.io.OutputStream |
---|
close, flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SockOutputStream(SchoonerSockIO sock)
sock
- specified socket for this outputstream.Method Detail |
---|
public final int getCount()
public final void resetCount()
public final SchoonerSockIO getSock()
public final void write(int b) throws IOException
write
in class OutputStream
IOException
public final void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public final void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |