public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); ByteBufferUtil.writeShortLength(bb, header); if (!isAlias) bb.put(ByteBufferUtil.bytes(comparatorName)); } }
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); ByteBufferUtil.writeShortLength(bb, header); if (!isAlias) bb.put(ByteBufferUtil.bytes(comparatorName)); } }
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); ByteBufferUtil.writeShortLength(bb, header); if (!isAlias) bb.put(ByteBufferUtil.bytes(comparatorName)); } }
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); ByteBufferUtil.writeShortLength(bb, header); if (!isAlias) bb.put(ByteBufferUtil.bytes(comparatorName)); } }
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); ByteBufferUtil.writeShortLength(bb, header); if (!isAlias) bb.put(ByteBufferUtil.bytes(comparatorName)); } }
public static ByteBuffer build(ByteBuffer... buffers) { int totalLength = 0; for (ByteBuffer bb : buffers) totalLength += 2 + bb.remaining() + 1; ByteBuffer out = ByteBuffer.allocate(totalLength); for (ByteBuffer bb : buffers) { ByteBufferUtil.writeShortLength(out, bb.remaining()); out.put(bb.duplicate()); out.put((byte) 0); } out.flip(); return out; }
public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers) { int totalLength = isStatic ? 2 : 0; for (ByteBuffer bb : buffers) totalLength += 2 + bb.remaining() + 1; ByteBuffer out = ByteBuffer.allocate(totalLength); if (isStatic) out.putShort((short)STATIC_MARKER); for (ByteBuffer bb : buffers) { ByteBufferUtil.writeShortLength(out, bb.remaining()); int toCopy = bb.remaining(); ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy); out.position(out.position() + toCopy); out.put((byte) 0); } out.flip(); return out; }
public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers) { int totalLength = isStatic ? 2 : 0; for (ByteBuffer bb : buffers) totalLength += 2 + bb.remaining() + 1; ByteBuffer out = ByteBuffer.allocate(totalLength); if (isStatic) out.putShort((short)STATIC_MARKER); for (ByteBuffer bb : buffers) { ByteBufferUtil.writeShortLength(out, bb.remaining()); int toCopy = bb.remaining(); ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy); out.position(out.position() + toCopy); out.put((byte) 0); } out.flip(); return out; }
public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers) { int totalLength = isStatic ? 2 : 0; for (ByteBuffer bb : buffers) totalLength += 2 + bb.remaining() + 1; ByteBuffer out = ByteBuffer.allocate(totalLength); if (isStatic) out.putShort((short)STATIC_MARKER); for (ByteBuffer bb : buffers) { ByteBufferUtil.writeShortLength(out, bb.remaining()); int toCopy = bb.remaining(); ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy); out.position(out.position() + toCopy); out.put((byte) 0); } out.flip(); return out; }
public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers) { int totalLength = isStatic ? 2 : 0; for (ByteBuffer bb : buffers) totalLength += 2 + bb.remaining() + 1; ByteBuffer out = ByteBuffer.allocate(totalLength); if (isStatic) out.putShort((short)STATIC_MARKER); for (ByteBuffer bb : buffers) { ByteBufferUtil.writeShortLength(out, bb.remaining()); int toCopy = bb.remaining(); ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy); out.position(out.position() + toCopy); out.put((byte) 0); } out.flip(); return out; }
public ByteBuffer toByteBuffer() { // This is the legacy format of composites. // See org.apache.cassandra.db.marshal.CompositeType for details. ByteBuffer result = ByteBuffer.allocate(dataSize() + 3 * size() + (isStatic() ? 2 : 0)); if (isStatic()) ByteBufferUtil.writeShortLength(result, CompositeType.STATIC_MARKER); for (int i = 0; i < size(); i++) { ByteBuffer bb = get(i); ByteBufferUtil.writeShortLength(result, bb.remaining()); result.put(bb.duplicate()); result.put((byte)0); } result.flip(); return result; }
public ByteBuffer toByteBuffer() { // for simple sparse we just return our one name buffer switch (nametype()) { case SIMPLE_DENSE: case SIMPLE_SPARSE: return get(0); case COMPOUND_DENSE: case COMPOUND_SPARSE_STATIC: case COMPOUND_SPARSE: // This is the legacy format of composites. // See org.apache.cassandra.db.marshal.CompositeType for details. ByteBuffer result = ByteBuffer.allocate(cellDataSize()); if (isStatic()) ByteBufferUtil.writeShortLength(result, CompositeType.STATIC_MARKER); for (int i = 0; i < size(); i++) { ByteBuffer bb = get(i); ByteBufferUtil.writeShortLength(result, bb.remaining()); result.put(bb); result.put((byte) 0); } result.flip(); return result; default: throw new AssertionError(); } }
ByteBufferUtil.writeShortLength(bb, component.remaining());
ByteBufferUtil.writeShortLength(bb, component.remaining());
ByteBufferUtil.writeShortLength(bb, component.remaining());
ByteBufferUtil.writeShortLength(bb, component.remaining());
ByteBufferUtil.writeShortLength(bb, component.remaining());