public interface Writer
| Modifier and Type | Method and Description |
|---|---|
byte[] |
buf()
Current buffer
|
boolean |
bufIsDataAfterMark()
Buffer has data after marked position
|
void |
close()
Close socket stream
|
void |
flush()
Send packet to socket.
|
void |
flushBufferStopAtMark()
Flush to last mark.
|
void |
flushPipeline()
Send packet to buffered outputstream without flushing
|
long |
getCmdLength()
Get current command length
|
byte |
getSequence()
Get current sequence object
|
boolean |
hasFlushed()
Current command has flushed packet to socket
|
void |
initPacket()
reset sequences and position for sending a new packet
|
boolean |
isMarked()
has some position been marked
|
void |
mark()
mark position
|
void |
permitTrace(boolean permitTrace)
Indicate if logging trace are permitted
|
int |
pos()
current buffer position
|
void |
pos(int pos)
Set current buffer position
|
byte[] |
resetMark()
Reset mark flag and send bytes after mark flag.
|
void |
setMaxAllowedPacket(int maxAllowedPacket)
Set max allowed packet size.
|
void |
setServerThreadId(Long serverThreadId,
HostAddress hostAddress)
Set server thread id.
|
boolean |
throwMaxAllowedLength(int length)
must a max allowed length exception be thrown
|
void |
writeAscii(String str) |
void |
writeByte(int value)
Write byte into buf, flush buf to socket if needed.
|
void |
writeBytes(byte[] arr) |
void |
writeBytes(byte[] arr,
int off,
int len)
Write byte array to buf.
|
void |
writeBytesAtPos(byte[] arr,
int pos) |
void |
writeBytesEscaped(byte[] bytes,
int len)
Write escape bytes to socket.
|
void |
writeDouble(double value) |
void |
writeEmptyPacket()
Send empty packet.
|
void |
writeFloat(float value) |
void |
writeInt(int value)
Write int value into buf.
|
void |
writeLength(long length)
Write field length into buf, flush socket if needed.
|
void |
writeLong(long value)
Write long value into buf.
|
void |
writeShort(short value)
Write short value into buf.
|
void |
writeString(String str) |
void |
writeStringEscaped(String str)
Write string to socket.
|
int pos()
byte[] buf()
void pos(int pos) throws IOException
pos - positionIOException - if buffer cannot grow to positionvoid writeByte(int value)
throws IOException
value - byte to sendIOException - if socket error occur.void writeShort(short value)
throws IOException
value - short valueIOException - if socket error occurvoid setMaxAllowedPacket(int maxAllowedPacket)
void writeInt(int value)
throws IOException
value - int valueIOException - if socket error occurvoid writeLong(long value)
throws IOException
value - long valueIOException - if socket error occurvoid writeDouble(double value)
throws IOException
IOExceptionvoid writeFloat(float value)
throws IOException
IOExceptionvoid writeBytes(byte[] arr)
throws IOException
IOExceptionvoid writeBytesAtPos(byte[] arr,
int pos)
void writeBytes(byte[] arr,
int off,
int len)
throws IOException
arr - byte arrayoff - offsetlen - byte length to writeIOException - if socket error occurvoid writeLength(long length)
throws IOException
length - field lengthIOException - if socket error occur.void writeAscii(String str) throws IOException
IOExceptionvoid writeString(String str) throws IOException
IOExceptionvoid writeStringEscaped(String str) throws IOException
str - stringIOException - if socket error occurvoid writeBytesEscaped(byte[] bytes,
int len)
throws IOException
bytes - byteslen - len to writeIOException - if socket error occurvoid writeEmptyPacket()
throws IOException
IOException - if socket error occur.void flush()
throws IOException
IOException - if socket error occur.void flushPipeline()
throws IOException
IOException - if socket error occur.boolean throwMaxAllowedLength(int length)
length - command lengthlong getCmdLength()
void permitTrace(boolean permitTrace)
permitTrace - permits trace to be loggedvoid setServerThreadId(Long serverThreadId, HostAddress hostAddress)
serverThreadId - current server thread id.hostAddress - host informationvoid mark()
boolean isMarked()
boolean hasFlushed()
void flushBufferStopAtMark()
throws IOException
IOException - if flush fail.boolean bufIsDataAfterMark()
byte[] resetMark()
void initPacket()
void close()
throws IOException
IOException - if any error occursbyte getSequence()
Copyright © 2025 SingleStore. All rights reserved.