/** * Writes null to specified field in pipe * @param fieldId field to be written to */ public void writeNull(long fieldId) { DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, -1, StructRegistry.extractFieldPosition(fieldId)); }
/** * Writes null to specified field in pipe * @param fieldId field to be written to */ public void writeNull(long fieldId) { DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, -1, StructRegistry.extractFieldPosition(fieldId)); }
public void selectStructFromCachedIndexes(int[] indexOffsets) { StructRegistry structRegistry = Pipe.structRegistry(channelWriter.backingPipe); assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; DataOutputBlobWriter.commitBackData(channelWriter, indexOffsets[indexOffsets.length-1]);//last pos is structId int p = pos; while (--p>=0) { DataOutputBlobWriter.setIntBackData(channelWriter, positions[p], indexOffsets[p]); } pos = 0;//cleared for next time; }
public void selectStructFromCachedIndexes(int[] indexOffsets) { StructRegistry structRegistry = Pipe.structRegistry(channelWriter.backingPipe); assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; DataOutputBlobWriter.commitBackData(channelWriter, indexOffsets[indexOffsets.length-1]);//last pos is structId int p = pos; while (--p>=0) { DataOutputBlobWriter.setIntBackData(channelWriter, positions[p], indexOffsets[p]); } pos = 0;//cleared for next time; }
/** * Writes null to specified field in pipe * @param fieldId field to be written to */ public void writeNull(long fieldId) { DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, -1, StructRegistry.extractFieldPosition(fieldId)); }
/** * Writes text to specified field in pipe * @param fieldId field to write to * @return channelWriter */ public Appendable writeText(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Text); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); return channelWriter; }
/** * Writes blob to specified field in pipe * @param fieldId field association showing where to write * @return channelWriter */ public ChannelWriter writeBlob(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Blob); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); return channelWriter; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes short to specified field in pipe * @param value short to be written * @param fieldId field to be written to */ public void writeShort(short value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedShort(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes long null to specified field in pipe * @param fieldId field to write to */ public void writeLongNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Long); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes null boolean to specified field in pipe * @param fieldId field to write to */ public void writeBooleanNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Boolean); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeBooleanNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes rational to specified field in pipe * @param numerator of rational to be written * @param denominator of rational to be written * @param fieldId field to be written to */ public void writeRational(long numerator, long denominator, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Rational); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeRational(numerator, denominator); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes short to specified field in pipe * @param value short to be written * @param fieldId field to be written to */ public void writeShort(short value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedShort(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes float to specified field in pipe * @param value float to be written * @param fieldId field to be written to */ public void writeFloat(float value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Float); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeFloat(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes short to specified field in pipe * @param value short to be written * @param fieldId field to be written to */ public void writeShort(short value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedShort(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes float to specified field in pipe * @param value float to be written * @param fieldId field to be written to */ public void writeFloat(float value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Float); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeFloat(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes null boolean to specified field in pipe * @param fieldId field to write to */ public void writeBooleanNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Boolean); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeBooleanNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes long null to specified field in pipe * @param fieldId field to write to */ public void writeLongNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Long); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }