public byte[] getChunk() { return ThriftUtils.toBytes(chunk); }
public BlobChunk setChunk(ByteBuffer chunk) { free(); this.chunk = chunk != null ? ByteBuffer.wrap(ThriftUtils.toBytes(chunk)) : null; return this; }
/** * Performs a deep copy on <i>other</i>. */ public BlobChunk(BlobChunk other) { __isset_bitfield = other.__isset_bitfield; ByteBufferReference reference = other.chunkReference; if (reference != null) { assignChunkReference(reference); } else if (other.chunk != null) { // always own the chunk if (other.chunk.isDirect()) { this.chunk = ByteBuffer.wrap(ThriftUtils.toBytes(other.chunk)); } else { this.chunk = other.chunk.duplicate(); } } this.last = other.last; this.lobId = other.lobId; this.offset = other.offset; this.totalLength = other.totalLength; }
public byte[] getJava_val() { if (getSetField() == _Fields.JAVA_VAL) { ByteBuffer buffer = (ByteBuffer)getFieldValue(); if (buffer == null) { return null; } if (!TBaseHelper.wrapsFullArray(buffer)) { // replace with byte array wrapper buffer = ByteBuffer.wrap(ThriftUtils.toBytes(buffer)); setJava_val(buffer); } return buffer.array(); } else { throw new RuntimeException( "Cannot get field 'java_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public byte[] getBinary_val() { if (getSetField() == _Fields.BINARY_VAL) { ByteBuffer buffer = (ByteBuffer)getFieldValue(); if (buffer == null) { return null; } if (!TBaseHelper.wrapsFullArray(buffer)) { // replace with byte array wrapper buffer = ByteBuffer.wrap(ThriftUtils.toBytes(buffer)); setBinary_val(buffer); } return buffer.array(); } else { throw new RuntimeException( "Cannot get field 'binary_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
if (field.type == ColumnValue.BINARY_VAL_FIELD_DESC.type) { ensureNonPrimCapacity(nonPrimSize); byte[] bytes = ThriftUtils.toBytes(iprot.readBinary()); primitives[offset] = nonPrimSize; nonPrimitives[nonPrimSize++] = bytes; if (field.type == ColumnValue.JAVA_VAL_FIELD_DESC.type) { ensureNonPrimCapacity(nonPrimSize); byte[] serializedBytes = ThriftUtils.toBytes( iprot.readBinary()); primitives[offset] = nonPrimSize;