public void get(int index, NullableUInt1Holder holder) { holder.isSet = 1; holder.value = data.getByte(index * VALUE_WIDTH); }
public void get(int index, NullableTinyIntHolder holder) { holder.isSet = 1; holder.value = data.getByte(index * VALUE_WIDTH); }
public byte get(int index) { return data.getByte(index * VALUE_WIDTH); }
@Override protected byte _getByte(int index) { return getByte(index); }
public byte get(int index) { return data.getByte(index * VALUE_WIDTH); }
public void get(int index, UInt1Holder holder) { holder.value = data.getByte(index * VALUE_WIDTH); }
public void get(int index, TinyIntHolder holder) { holder.value = data.getByte(index * VALUE_WIDTH); }
/** * Get the byte holding the desired bit, then mask all other bits. Iff the result is 0, the bit was not set. * * @param index * position of the bit in the vector * @return 1 if set, otherwise 0 */ public final int get(int index) { int byteIndex = index >> 3; byte b = data.getByte(byteIndex); int bitIndex = index & 7; return Long.bitCount(b & (1L << bitIndex)); }
public void copyFrom(int fromIndex, int thisIndex, UInt1Vector from) { data.setByte(thisIndex * VALUE_WIDTH, from.data.getByte(fromIndex * VALUE_WIDTH) ); }
public void copyFrom(int fromIndex, int thisIndex, TinyIntVector from) { data.setByte(thisIndex * VALUE_WIDTH, from.data.getByte(fromIndex * VALUE_WIDTH) ); }
/** * Set the bit at the given index to the specified value. * * @param index * position of the bit to set * @param value * value to set (either 1 or 0) */ public final void set(int index, int value) { int byteIndex = index >> 3; int bitIndex = index & 7; byte currentByte = data.getByte(byteIndex); byte bitMask = (byte) (1L << bitIndex); if (value != 0) { currentByte |= bitMask; } else { currentByte -= (bitMask & currentByte); } data.setByte(byteIndex, currentByte); }
shiftOrder = 6; shiftBits = 0x00; intermediateBytes[intermediateIndex++] = (byte) (data.getByte(startIndex) & 0x7F); } else if (maxPrecision == 28) { maskIndex = 1; shiftOrder = 4; shiftBits = (byte) ((data.getByte(startIndex) & 0x03) << shiftOrder); intermediateBytes[intermediateIndex++] = (byte) (((data.getByte(startIndex) & 0x3C) & 0xFF) >>> 2); } else { throw new UnsupportedOperationException("Dense types with max precision 38 and 28 are only supported"); boolean sign = false; if ((data.getByte(startIndex) & 0x80) != 0) { sign = true; intermediateBytes[intermediateIndex] = (byte) ((shiftBits) | (((data.getByte(startIndex + inputIndex) & reverseMask[maskIndex]) & 0xFF) >>> (8 - shiftOrder))); shiftBits = (byte) ((data.getByte(startIndex + inputIndex) & mask[maskIndex]) << shiftOrder);
byteI = this.data.getByte(firstByteIndex + i); byteIPlus1 = this.data.getByte(firstByteIndex + i + 1); byte lastButOneByte = (numBytesHoldingSourceBits == 1) ? this.data.getByte(firstByteIndex) : byteIPlus1; byte bitsFromLastButOneByte = (byte)((lastButOneByte & 0xFF) >>> firstBitOffset); 0 : this.data.getByte(firstByteIndex + numBytesHoldingSourceBits); target.data.setByte(numBytesHoldingSourceBits - 1, bitsFromLastButOneByte + (lastByte << (8 - firstBitOffset))); } else { target.data.setByte(numBytesHoldingSourceBits - 1, (((this.data.getByte(firstByteIndex + numBytesHoldingSourceBits - 1) & 0xFF) >>> firstBitOffset) + (this.data.getByte(firstByteIndex + numBytesHoldingSourceBits) << (8 - firstBitOffset))));
@Override public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length) { final int BULK_COPY_THR = 16; // Performance profiling indicated that using the "putByte()" method is faster for short // data lengths (less than 16 bytes) than using the "copyMemory()" method. if (length < BULK_COPY_THR && udle.hasMemoryAddress() && dst.hasMemoryAddress()) { if (dst.capacity() < (dstIndex + length)) { throw new IndexOutOfBoundsException(); } for (int idx = 0; idx < length; ++idx) { byte value = getByte(index + idx); PlatformDependent.putByte(dst.memoryAddress() + dstIndex + idx, value); } } else { udle.getBytes(index + offset, dst, dstIndex, length); } return this; }
@Override public void eval() { out.value = in.buffer.getByte(in.start); } }
assertEquals((byte) i, slice1.getByte(i));
public void copyFrom(int fromIndex, int thisIndex, TinyIntVector from) { data.setByte(thisIndex * VALUE_WIDTH, from.data.getByte(fromIndex * VALUE_WIDTH) ); }
public void copyFrom(int fromIndex, int thisIndex, UInt1Vector from) { data.setByte(thisIndex * VALUE_WIDTH, from.data.getByte(fromIndex * VALUE_WIDTH) ); }