@Override public void putShortInt(int rowId, int value) { byte[] converted = ByteUtil.to3Bytes(value); System.arraycopy(converted, 0, shortIntData, rowId * 3, 3); }
@Override public void putShortInt(int rowId, int value) { ensureArraySize(rowId, DataTypes.SHORT_INT); byte[] converted = ByteUtil.to3Bytes(value); System.arraycopy(converted, 0, shortIntData, rowId * 3, 3); arrayElementCount++; totalLength += DataTypes.SHORT_INT.getSizeInBytes(); }
@Override public void putShortInt(int rowId, int value) { byte[] data = ByteUtil.to3Bytes(value); long offset = rowId * 3L; CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset, data[0]); CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset + 1, data[1]); CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset + 2, data[2]); }
@Override public void putShortInt(int rowId, int value) { try { ensureMemory(ByteUtil.SIZEOF_SHORT_INT); } catch (MemoryException e) { throw new RuntimeException(e); } byte[] data = ByteUtil.to3Bytes(value); long offset = rowId * 3L; CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset, data[0]); CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset + 1, data[1]); CarbonUnsafe.getUnsafe().putByte(baseAddress, baseOffset + offset + 2, data[2]); totalLength += ByteUtil.SIZEOF_SHORT_INT; updatePageSize(rowId); }