/** * Data written so far is directly copied to the destination writer. * @param writer target writer */ public void replicate(DataOutputBlobWriter<?> writer) { writer.write(backingPipe.blobRing, startPosition, activePosition-startPosition, backingPipe.blobMask); }
public void populate(DataOutputBlobWriter<?> writer) { int location = writer.position(); DataOutputBlobWriter.setIntBackData(writer, location, fieldPos); writer.writeShort(textBytes.length); writer.write(textBytes); prev.populate(writer); } };
public void populate(DataOutputBlobWriter<?> writer) { int location = writer.position(); DataOutputBlobWriter.setIntBackData(writer, location, fieldPos); writer.writeShort(textBytes.length); writer.write(textBytes); prev.populate(writer); } };
@Override public void readInto(ChannelWriter writer, int length) { DataOutputBlobWriter.write((DataOutputBlobWriter<?>)writer, backing, position, length, byteMask); position += length; }
@Override public void write(byte[] b) { DataOutputBlobWriter.write(this, b, 0, b.length); }
/** * Data written so far and in the offset to length segment is directly copied to the destination writer. * @param writer * @param offset from start of the writer, 0 is the start * @param length must not be longer than bytes written. */ public void replicate(DataOutputBlobWriter<?> writer, int offset, int length) { assert(length<= (activePosition-startPosition)); writer.write(backingPipe.blobRing, startPosition+offset, length, backingPipe.blobMask); }
public <T extends MessageSchema<T>> void readInto(DataOutputBlobWriter<T> writer, int length) { DataOutputBlobWriter.write(writer, backing, position, length, byteMask); position += length; }
public static int parseCopy(TrieParserReader reader, long count, DataOutputBlobWriter<?> writer) { int len = (int)Math.min(count, (long)reader.sourceLen); DataOutputBlobWriter.write(writer, reader.sourceBacking, reader.sourcePos, len, reader.sourceMask); reader.sourcePos += len; reader.sourceLen -= len; assert(reader.sourceLen>=0); return len; }
public static int writeCapturedUTF8(TrieParserReader reader, int idx, ChannelWriter target) { int pos = idx*4; int type = reader.capturedValues[pos++]; assert(type==0); int p = reader.capturedValues[pos++]; int l = reader.capturedValues[pos++]; int m = reader.capturedValues[pos++]; //this data is already encoded as UTF8 so we do a direct copy target.writeShort(l); DataOutputBlobWriter.write((DataOutputBlobWriter<?>) target, reader.capturedBlobArray, p, l, m); return l; }
@Override public void write(byte[] b) { checkLimit(this,b.length); super.write(b); }
@Override public void write(byte[] b, int off, int len) { checkLimit(this,len); super.write(b, off, len); }
@Override public void write(int b) { checkLimit(this,1); super.write(b); }
public void copyTo(Appendable target) { if (target instanceof DataOutputBlobWriter) { ((DataOutputBlobWriter)target).write(buffer, 0, byteCount, Integer.MAX_VALUE); } else { Appendables.appendUTF8(target, buffer, 0, byteCount, Integer.MAX_VALUE); } }
public void copyTo(Appendable target) { if (target instanceof DataOutputBlobWriter) { ((DataOutputBlobWriter)target).write(buffer, 0, byteCount, Integer.MAX_VALUE); } else { Appendables.appendUTF8(target, buffer, 0, byteCount, Integer.MAX_VALUE); } }
private static void unScopedCheckForTrack(MsgCommandChannel cmd, DataOutputBlobWriter<MessagePubSub> output) { boolean addSuffix=false; addSuffix = BuilderImpl.notUnscoped(TrieParserReaderLocal.get(), output); if (addSuffix) { output.write(cmd.track); } }
/** * Writes byte to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value byte to be written */ public void writeByte(Object assoc, byte value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.write(value); }
/** * Writes byte to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value byte to be written */ public void writeByte(Object assoc, byte value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.write(value); }
/** * Writes byte to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value byte to be written */ public void writeByte(Object assoc, byte value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.write(value); }
private void publishConnectionFeedback() { if (connectionFeedbackTopic != null) { PipeWriter.presumeWriteFragment(output, IngressMessages.MSG_PUBLISH_103); PipeWriter.writeUTF8(output, IngressMessages.MSG_PUBLISH_103_FIELD_TOPIC_1, connectionFeedbackTopic); DataOutputBlobWriter<IngressMessages> stream = PipeWriter.outputStream(output); DataOutputBlobWriter.openField(stream); stream.write(connectResult); stream.closeHighLevelField(IngressMessages.MSG_PUBLISH_103_FIELD_PAYLOAD_3); PipeWriter.publishWrites(output); } } }