use of io.mycat.beans.mysql.MySQLPayloadWriter in project Mycat2 by MyCATApache.
the class BinaryResultSetResponse method convertString.
public static byte[] convertString(Object object) {
byte[] bytes;
if (object instanceof byte[]) {
bytes = (byte[]) object;
} else {
bytes = object.toString().getBytes();
}
MySQLPayloadWriter mySQLPayloadWriter = new MySQLPayloadWriter(bytes.length);
mySQLPayloadWriter.writeLenencBytes(bytes);
return mySQLPayloadWriter.toByteArray();
}
Aggregations