Beispiel #1
0
 public void setString(int columnIndex, String value) {
   Integer reuseIndex = stringReferences.get(value);
   if (reuseIndex != null) {
     bufferSlice.setInt(getOffset(columnIndex), reuseIndex);
   } else {
     int index = stringReferences.size();
     stringReferences.put(value, index);
     bufferSlice.setInt(getOffset(columnIndex), index);
     stringReferenceSize +=
         value.length() * 2 + 4; // assuming size of char = size of byte * 2 + length
   }
   clearNull(columnIndex);
 }
Beispiel #2
0
 public void setDouble(int columnIndex, double value) {
   bufferSlice.setDouble(getOffset(columnIndex), value);
   clearNull(columnIndex);
 }
Beispiel #3
0
 public void setLong(int columnIndex, long value) {
   bufferSlice.setLong(getOffset(columnIndex), value);
   clearNull(columnIndex);
 }
Beispiel #4
0
 public void setBoolean(int columnIndex, boolean value) {
   bufferSlice.setByte(getOffset(columnIndex), value ? (byte) 1 : (byte) 0);
   clearNull(columnIndex);
 }
Beispiel #5
0
 public void setTimestamp(int columnIndex, Timestamp value) {
   int offset = getOffset(columnIndex);
   bufferSlice.setLong(offset, value.getEpochSecond());
   bufferSlice.setInt(offset + 8, value.getNano());
   clearNull(columnIndex);
 }