@Override public ByteBuffer[] split(ByteBuffer name) { // Assume all components, we'll trunk the array afterwards if need be, but // most names will be complete. ByteBuffer[] l = new ByteBuffer[types.size()]; ByteBuffer bb = name.duplicate(); int i = 0; while (bb.remaining() > 0) { l[i++] = ByteBufferUtil.readBytesWithShortLength(bb); bb.get(); // skip end-of-component } return i == l.length ? l : Arrays.copyOfRange(l, 0, i); }
public static List<ByteBuffer> splitName(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<>(); ByteBuffer bb = name.duplicate(); readStatic(bb); while (bb.remaining() > 0) { l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l; }
public static List<ByteBuffer> splitName(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<>(); ByteBuffer bb = name.duplicate(); readStatic(bb); while (bb.remaining() > 0) { l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l; }
public static List<ByteBuffer> splitName(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<>(); ByteBuffer bb = name.duplicate(); readStatic(bb); while (bb.remaining() > 0) { l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l; }
public static List<ByteBuffer> splitName(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<>(); ByteBuffer bb = name.duplicate(); readStatic(bb); while (bb.remaining() > 0) { l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l; }
public static ByteBuffer extractComponent(ByteBuffer bb, int idx) { bb = bb.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { ByteBuffer c = ByteBufferUtil.readBytesWithShortLength(bb); if (i == idx) return c; bb.get(); // skip end-of-component ++i; } return null; }
public static ByteBuffer extractComponent(ByteBuffer bb, int idx) { bb = bb.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { ByteBuffer c = ByteBufferUtil.readBytesWithShortLength(bb); if (i == idx) return c; bb.get(); // skip end-of-component ++i; } return null; }
public static ByteBuffer extractComponent(ByteBuffer bb, int idx) { bb = bb.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { ByteBuffer c = ByteBufferUtil.readBytesWithShortLength(bb); if (i == idx) return c; bb.get(); // skip end-of-component ++i; } return null; }
@Override public ByteBuffer[] split(ByteBuffer name) { // Assume all components, we'll trunk the array afterwards if need be, but // most names will be complete. ByteBuffer[] l = new ByteBuffer[types.size()]; ByteBuffer bb = name.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { l[i++] = ByteBufferUtil.readBytesWithShortLength(bb); bb.get(); // skip end-of-component } return i == l.length ? l : Arrays.copyOfRange(l, 0, i); }
public static ByteBuffer readValue(ByteBuffer input, int version) { if (version >= Server.VERSION_3) { int size = input.getInt(); if (size < 0) return null; return ByteBufferUtil.readBytes(input, size); } else { return ByteBufferUtil.readBytesWithShortLength(input); } }
@Override public ByteBuffer[] split(ByteBuffer name) { // Assume all components, we'll trunk the array afterwards if need be, but // most names will be complete. ByteBuffer[] l = new ByteBuffer[types.size()]; ByteBuffer bb = name.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { l[i++] = ByteBufferUtil.readBytesWithShortLength(bb); bb.get(); // skip end-of-component } return i == l.length ? l : Arrays.copyOfRange(l, 0, i); }
public static ByteBuffer extractComponent(ByteBuffer bb, int idx) { bb = bb.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { ByteBuffer c = ByteBufferUtil.readBytesWithShortLength(bb); if (i == idx) return c; bb.get(); // skip end-of-component ++i; } return null; }
public static ByteBuffer extractComponent(ByteBuffer bb, int idx) { bb = bb.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { ByteBuffer c = ByteBufferUtil.readBytesWithShortLength(bb); if (i == idx) return c; bb.get(); // skip end-of-component ++i; } return null; }
@Override public ByteBuffer[] split(ByteBuffer name) { // Assume all components, we'll trunk the array afterwards if need be, but // most names will be complete. ByteBuffer[] l = new ByteBuffer[types.size()]; ByteBuffer bb = name.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { l[i++] = ByteBufferUtil.readBytesWithShortLength(bb); bb.get(); // skip end-of-component } return i == l.length ? l : Arrays.copyOfRange(l, 0, i); }
@Override public ByteBuffer[] split(ByteBuffer name) { // Assume all components, we'll trunk the array afterwards if need be, but // most names will be complete. ByteBuffer[] l = new ByteBuffer[types.size()]; ByteBuffer bb = name.duplicate(); readStatic(bb); int i = 0; while (bb.remaining() > 0) { l[i++] = ByteBufferUtil.readBytesWithShortLength(bb); bb.get(); // skip end-of-component } return i == l.length ? l : Arrays.copyOfRange(l, 0, i); }
/** * Split a composite column names into it's components. */ public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l.toArray(new ByteBuffer[l.size()]); } private static final String COLON = ":";
/** * Split a composite column names into it's components. */ public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l.toArray(new ByteBuffer[l.size()]); } private static final String COLON = ":";
/** * Split a composite column names into it's components. */ public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l.toArray(new ByteBuffer[l.size()]); }
/** * Split a composite column names into it's components. */ public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWithShortLength(bb)); bb.get(); // skip end-of-component } return l.toArray(new ByteBuffer[l.size()]); } private static final String COLON = ":";
public List<CompositeComponent> deconstruct( ByteBuffer bytes ) { List<CompositeComponent> list = new ArrayList<CompositeComponent>(); ByteBuffer bb = bytes.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { AbstractType comparator = getComparator(i, bb); ByteBuffer value = ByteBufferUtil.readBytesWithShortLength(bb); list.add( new CompositeComponent(comparator,value) ); byte b = bb.get(); // Ignore; not relevant here ++i; } return list; }