ClientPreparedQueryBindings
setInt method do following things
@Override
public void setInt(int parameterIndex, int x) {
setValue(parameterIndex, String.valueOf(x), MysqlType.INT);
}
public synchronized final void setValue(int paramIndex, String val, MysqlType type) {
byte[] parameterAsBytes = StringUtils.getBytes(val, this.charEncoding);
setValue(paramIndex, parameterAsBytes, type);
}
step1. convert int to String
step2. convert String to ascii byte array
My question is could we convert int directly to byte array?
setInt method do following things
@Override
public void setInt(int parameterIndex, int x) {
setValue(parameterIndex, String.valueOf(x), MysqlType.INT);
}
public synchronized final void setValue(int paramIndex, String val, MysqlType type) {
byte[] parameterAsBytes = StringUtils.getBytes(val, this.charEncoding);
setValue(paramIndex, parameterAsBytes, type);
}
step1. convert int to String
step2. convert String to ascii byte array
My question is could we convert int directly to byte array?