@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
/** * Made into a static method so as to reuse the logic * within ValueAndTagRewriteByteBufferExtendedCell */ static void write(ByteBuffer buf, int offset, Cell cell, byte[] value, byte[] tags) { offset = ByteBufferUtils.putInt(buf, offset, KeyValueUtil.keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, value.length);// Value length offset = KeyValueUtil.appendKeyTo(cell, buf, offset); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, value, 0, value.length); offset += value.length; int tagsLen = tags == null ? 0 : tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, tags, 0, tagsLen); } }
/** * Copy the Cell content into the passed buf in KeyValue serialization format. */ public static int appendTo(Cell cell, ByteBuffer buf, int offset, boolean withTags) { offset = ByteBufferUtils.putInt(buf, offset, keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, cell.getValueLength());// Value length offset = appendKeyTo(cell, buf, offset); offset = CellUtil.copyValueTo(cell, buf, offset);// Value bytes int tagsLength = cell.getTagsLength(); if (withTags && (tagsLength > 0)) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLength);// Tags length offset = PrivateCellUtil.copyTagsTo(cell, buf, offset);// Tags bytes } return offset; }
@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
@Override public void write(ByteBuffer buf, int offset) { offset = KeyValueUtil.appendTo(this.cell, buf, offset, false); int tagsLen = this.tags == null ? 0 : this.tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, this.tags, 0, tagsLen); } }
/** * Made into a static method so as to reuse the logic * within ValueAndTagRewriteByteBufferExtendedCell */ static void write(ByteBuffer buf, int offset, Cell cell, byte[] value, byte[] tags) { offset = ByteBufferUtils.putInt(buf, offset, KeyValueUtil.keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, value.length);// Value length offset = KeyValueUtil.appendKeyTo(cell, buf, offset); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, value, 0, value.length); offset += value.length; int tagsLen = tags == null ? 0 : tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, tags, 0, tagsLen); } }
/** * Made into a static method so as to reuse the logic * within ValueAndTagRewriteByteBufferExtendedCell */ static void write(ByteBuffer buf, int offset, Cell cell, byte[] value, byte[] tags) { offset = ByteBufferUtils.putInt(buf, offset, KeyValueUtil.keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, value.length);// Value length offset = KeyValueUtil.appendKeyTo(cell, buf, offset); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, value, 0, value.length); offset += value.length; int tagsLen = tags == null ? 0 : tags.length; if (tagsLen > 0) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLen); ByteBufferUtils.copyFromArrayToBuffer(buf, offset, tags, 0, tagsLen); } }
/** * Copy the Cell content into the passed buf in KeyValue serialization format. */ public static int appendTo(Cell cell, ByteBuffer buf, int offset, boolean withTags) { offset = ByteBufferUtils.putInt(buf, offset, keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, cell.getValueLength());// Value length offset = appendKeyTo(cell, buf, offset); offset = CellUtil.copyValueTo(cell, buf, offset);// Value bytes int tagsLength = cell.getTagsLength(); if (withTags && (tagsLength > 0)) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLength);// Tags length offset = PrivateCellUtil.copyTagsTo(cell, buf, offset);// Tags bytes } return offset; }
/** * Copy the Cell content into the passed buf in KeyValue serialization format. */ public static int appendTo(Cell cell, ByteBuffer buf, int offset, boolean withTags) { offset = ByteBufferUtils.putInt(buf, offset, keyLength(cell));// Key length offset = ByteBufferUtils.putInt(buf, offset, cell.getValueLength());// Value length offset = appendKeyTo(cell, buf, offset); offset = CellUtil.copyValueTo(cell, buf, offset);// Value bytes int tagsLength = cell.getTagsLength(); if (withTags && (tagsLength > 0)) { offset = ByteBufferUtils.putAsShort(buf, offset, tagsLength);// Tags length offset = PrivateCellUtil.copyTagsTo(cell, buf, offset);// Tags bytes } return offset; }