|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mysql.jdbc.Buffer
Buffer contains code to read and write packets from/to the MySQL server.
Field Summary | |
(package private) static int |
NO_LENGTH_LIMIT
|
(package private) static long |
NULL_LENGTH
|
Constructor Summary | |
(package private) |
Buffer(byte[] buf)
|
(package private) |
Buffer(int size)
|
Method Summary | |
(package private) void |
clear()
|
(package private) void |
dump()
|
(package private) void |
dumpHeader()
|
(package private) void |
dumpNBytes(int start,
int nBytes)
|
(package private) void |
ensureCapacity(int additionalData)
|
int |
fastSkipLenString()
Skip over a length-encoded string |
protected byte[] |
getBufferSource()
|
(package private) int |
getBufLength()
|
byte[] |
getByteBuffer()
Returns the array of bytes this Buffer is using to read from. |
(package private) byte[] |
getBytes(int len)
|
int |
getPosition()
Returns the current position to write to/ read from |
(package private) boolean |
isLastDataPacket()
|
(package private) long |
newReadLength()
|
(package private) byte |
readByte()
|
(package private) long |
readFieldLength()
|
(package private) int |
readInt()
|
(package private) byte[] |
readLenByteArray(int offset)
|
(package private) long |
readLength()
|
(package private) long |
readLong()
|
(package private) int |
readLongInt()
|
(package private) long |
readLongLong()
|
(package private) int |
readnBytes()
|
(package private) java.lang.String |
readString()
|
(package private) java.lang.String |
readString(java.lang.String encoding)
|
(package private) void |
setBufLength(int bufLength)
|
void |
setByteBuffer(byte[] byteBuffer)
Sets the array of bytes to use as a buffer to read from. |
void |
setPosition(int position)
Set the current position to write to/ read from |
(package private) void |
setSendLength(int sendLength)
|
void |
setWasMultiPacket(boolean flag)
Sets whether this packet was part of a multipacket |
boolean |
wasMultiPacket()
Was this packet part of a multipacket? |
(package private) void |
writeByte(byte b)
|
(package private) void |
writeBytesNoNull(byte[] bytes)
|
(package private) void |
writeBytesNoNull(byte[] bytes,
int offset,
int length)
|
(package private) void |
writeDouble(double d)
|
(package private) void |
writeFloat(float f)
|
(package private) void |
writeInt(int i)
|
(package private) void |
writeLong(long i)
|
(package private) void |
writeLongInt(int i)
|
(package private) void |
writeLongLong(long i)
|
(package private) void |
writeString(java.lang.String s)
|
(package private) void |
writeStringNoNull(java.lang.String s)
|
(package private) void |
writeStringNoNull(java.lang.String s,
java.lang.String encoding,
SingleByteCharsetConverter converter,
boolean parserKnowsUnicode)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int NO_LENGTH_LIMIT
static final long NULL_LENGTH
Constructor Detail |
Buffer(byte[] buf)
Buffer(int size)
Method Detail |
public void setByteBuffer(byte[] byteBuffer)
byteBuffer
- the array of bytes to use as a bufferpublic byte[] getByteBuffer()
public void setPosition(int position)
position
- the position (0-based index)public int getPosition()
public void setWasMultiPacket(boolean flag)
flag
- was this packet part of a multipacket?public int fastSkipLenString()
public boolean wasMultiPacket()
protected final byte[] getBufferSource()
final byte[] getBytes(int len)
final boolean isLastDataPacket()
final void clear()
final void dump()
final void dumpHeader()
final void dumpNBytes(int start, int nBytes)
final void ensureCapacity(int additionalData) throws java.sql.SQLException
java.sql.SQLException
final long newReadLength()
final byte readByte()
final long readFieldLength()
final int readInt()
final byte[] readLenByteArray(int offset)
final long readLength()
final long readLong()
final int readLongInt()
final long readLongLong()
final java.lang.String readString()
final java.lang.String readString(java.lang.String encoding) throws java.sql.SQLException
java.sql.SQLException
final int readnBytes()
final void writeByte(byte b) throws java.sql.SQLException
java.sql.SQLException
final void writeBytesNoNull(byte[] bytes) throws java.sql.SQLException
java.sql.SQLException
final void writeBytesNoNull(byte[] bytes, int offset, int length) throws java.sql.SQLException
java.sql.SQLException
final void writeDouble(double d)
final void writeFloat(float f)
final void writeInt(int i)
final void writeLong(long i)
final void writeLongInt(int i)
final void writeLongLong(long i)
final void writeString(java.lang.String s) throws java.sql.SQLException
java.sql.SQLException
final void writeStringNoNull(java.lang.String s) throws java.sql.SQLException
java.sql.SQLException
final void writeStringNoNull(java.lang.String s, java.lang.String encoding, SingleByteCharsetConverter converter, boolean parserKnowsUnicode) throws java.io.UnsupportedEncodingException, java.sql.SQLException
java.io.UnsupportedEncodingException
java.sql.SQLException
void setBufLength(int bufLength)
int getBufLength()
void setSendLength(int sendLength)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |