Example #1
0
 final void writeFieldLength(long length) throws SQLException {
   if (length < 251) {
     writeByte((byte) length);
   } else if (length < 65536L) {
     ensureCapacity(3);
     writeByte((byte) 252);
     writeInt((int) length);
   } else if (length < 16777216L) {
     ensureCapacity(4);
     writeByte((byte) 253);
     writeLongInt((int) length);
   } else {
     ensureCapacity(9);
     writeByte((byte) 254);
     writeLongLong(length);
   }
 }
Example #2
0
 final void writeDouble(double d) throws SQLException {
   long l = Double.doubleToLongBits(d);
   writeLongLong(l);
 }