public static ByteBuffer toByteBufferAndRewind(final Iterable<? extends KeyValue> kvs, boolean includeMemstoreTS) { int totalBytes = KeyValueUtil.totalLengthWithMvccVersion(kvs, includeMemstoreTS); ByteBuffer bb = ByteBuffer.allocate(totalBytes); for (KeyValue kv : IterableUtils.nullSafe(kvs)) { KeyValueUtil.appendToByteBuffer(bb, kv, includeMemstoreTS); } bb.rewind(); return bb; }
public static int totalLengthWithMvccVersion(final Iterable<? extends KeyValue> kvs, final boolean includeMvccVersion) { int length = 0; for (KeyValue kv : IterableUtils.nullSafe(kvs)) { length += lengthWithMvccVersion(kv, includeMvccVersion); } return length; }
public static ByteBuffer toByteBufferAndRewind(final Iterable<? extends KeyValue> kvs, boolean includeMemstoreTS) { int totalBytes = KeyValueTool.totalLengthWithMvccVersion(kvs, includeMemstoreTS); ByteBuffer bb = ByteBuffer.allocate(totalBytes); for (KeyValue kv : IterableUtils.nullSafe(kvs)) { KeyValueTool.appendToByteBuffer(bb, kv, includeMemstoreTS); } bb.rewind(); return bb; }
public ByteRangeTreeSet(List<ByteRange> rawByteArrays) { this();//needed to initialize the TreeSet for(ByteRange in : IterableUtils.nullSafe(rawByteArrays)){ add(in); } }
public ByteRangeHashSet(List<ByteRange> rawByteArrays) { for (ByteRange in : IterableUtils.nullSafe(rawByteArrays)) { add(in); } }