private static int accumLowLevelAPIField(LittleEndianDataInputBlobReader that) { if (0==that.length) { return openLowLevelAPIField(that); } else { int meta = Pipe.takeByteArrayMetaData((Pipe<?>) that.pipe); int len = Pipe.takeByteArrayLength((Pipe<?>) that.pipe); that.length += len; that.bytesLimit = that.pipe.blobMask & (that.bytesLimit + len); return len; } }
/** * Read var length field from the pipe, position must be set up first. Data is written to target field. * * @param pipe Pipe source * @param target DataOutputBlobWriter field written into * @return DataOutputBlobWriter target */ public static <S extends MessageSchema<S>> DataOutputBlobWriter<?> readBytes(Pipe<S> pipe, DataOutputBlobWriter<?> target) { return Pipe.readBytes(pipe, target, Pipe.takeByteArrayMetaData(pipe), Pipe.takeByteArrayLength(pipe)); }
/** * Read var length field from the pipe, position must be set up first. Data is written to target field. * * @param pipe Pipe source * @param target DataOutputBlobWriter field written into * @param <S> message schema * @return DataOutputBlobWriter target */ public static <S extends MessageSchema<S>> DataOutputBlobWriter<?> readBytes(Pipe<S> pipe, DataOutputBlobWriter<?> target) { return Pipe.readBytes(pipe, target, Pipe.takeByteArrayMetaData(pipe), Pipe.takeByteArrayLength(pipe)); }
private static int accumLowLevelAPIField(LittleEndianDataInputBlobReader that) { if (0==that.length) { return openLowLevelAPIField(that); } else { int meta = Pipe.takeByteArrayMetaData((Pipe<?>) that.pipe); int len = Pipe.takeByteArrayLength((Pipe<?>) that.pipe); that.length += len; that.bytesLimit = that.pipe.blobMask & (that.bytesLimit + len); return len; } }
/** * Read var length field from the pipe, position must be set up first. Data is written to target field. * * @param pipe Pipe source * @param target DataOutputBlobWriter field written into * @param <S> message schema * @return DataOutputBlobWriter target */ public static <S extends MessageSchema<S>> DataOutputBlobWriter<?> readBytes(Pipe<S> pipe, DataOutputBlobWriter<?> target) { return Pipe.readBytes(pipe, target, Pipe.takeByteArrayMetaData(pipe), Pipe.takeByteArrayLength(pipe)); }
private void buildPublishMessage(DataOutputBlobWriter<NetPayloadSchema> output, int qos, int packetId) { buildPublishMessage(output, qos, packetId, Pipe.takeInt(input), Pipe.takeByteArrayMetaData(input), Pipe.takeByteArrayLength(input), Pipe.takeByteArrayMetaData(input), Pipe.takeByteArrayLength(input)); }
private static int accumLowLevelAPIField(LittleEndianDataInputBlobReader that) { if (0==that.length) { return openLowLevelAPIField(that); } else { int meta = Pipe.takeByteArrayMetaData((Pipe<?>) that.pipe); int len = Pipe.takeByteArrayLength((Pipe<?>) that.pipe); that.length += len; that.bytesLimit = that.pipe.blobMask & (that.bytesLimit + len); return len; } }
private static int openLowLevelAPIField(LittleEndianDataInputBlobReader that) { int meta = Pipe.takeByteArrayMetaData((Pipe<?>) that.pipe); that.length = Pipe.takeByteArrayLength((Pipe<?>) that.pipe); that.position = Pipe.bytePosition(meta, that.pipe, that.length); that.backing = Pipe.byteBackingArray(meta, that.pipe); that.bytesLimit = that.pipe.blobMask & (that.position + that.length); return that.length; }
public int openLowLevelAPIField() { int meta = Pipe.takeByteArrayMetaData(this.pipe); this.isStructured = (0!=(Pipe.STRUCTURED_POS_MASK&meta)); this.length = Math.max(0, Pipe.takeByteArrayLength(this.pipe)); this.bytesLowBound = this.position = Pipe.bytePosition(meta, this.pipe, this.length); this.backing = Pipe.byteBackingArray(meta, this.pipe); assert(this.backing!=null) : "The pipe "+(1==(meta>>31)?" constant array ": " blob ")+"must be defined before use.\n "+this.pipe; this.bytesHighBound = this.pipe.blobMask & (this.position + this.length); assert(Pipe.validatePipeBlobHasDataToRead(this.pipe, this.position, this.length)); return this.length; }
private static int openLowLevelAPIField(LittleEndianDataInputBlobReader that) { int meta = Pipe.takeByteArrayMetaData((Pipe<?>) that.pipe); that.length = Pipe.takeByteArrayLength((Pipe<?>) that.pipe); that.position = Pipe.bytePosition(meta, that.pipe, that.length); that.backing = Pipe.byteBackingArray(meta, that.pipe); that.bytesLimit = that.pipe.blobMask & (that.position + that.length); return that.length; }
private int sendNewContent(byte[] targetData, int targetOffset, int targetLength) { int msgId = Pipe.takeMsgIdx(pipe); if (msgId>=0) { //exit EOF logic int meta = Pipe.takeByteArrayMetaData((Pipe<?>) pipe);//side effect, this moves the pointer and must happen before we call for length int sourceLength = Pipe.takeByteArrayLength((Pipe<?>) pipe); return beginNewContent(targetData, targetOffset, targetLength, meta, sourceLength); } else { // Pipe.confirmLowLevelRead(ring, recordSize);//wrong size? Pipe.releaseReadLock(pipe); //TOOD: bad idea needs more elegant solution. // closed = true; return -1; } }
public static long query(TrieParserReader trieReader, TrieParser trie, Pipe<?> input, final long unfoundResult) { int meta = Pipe.takeByteArrayMetaData(input); int length = Pipe.takeByteArrayLength(input); return query(trieReader, trie, Pipe.byteBackingArray(meta, input), Pipe.bytePosition(meta, input, length), length, Pipe.blobMask(input), unfoundResult ); }
public static long query(TrieParserReader trieReader, TrieParser trie, Pipe<?> input, final long unfoundResult) { int meta = Pipe.takeByteArrayMetaData(input); int length = Pipe.takeByteArrayLength(input); return query(trieReader, trie, Pipe.byteBackingArray(meta, input), Pipe.bytePosition(meta, input, length), length, Pipe.blobMask(input), unfoundResult ); }
public static void parseSetup(TrieParserReader trieReader, Pipe<?> input) { //TODO: cofirm this field is next... int meta = Pipe.takeByteArrayMetaData(input); int length = Pipe.takeByteArrayLength(input); parseSetup(trieReader, Pipe.byteBackingArray(meta, input), Pipe.bytePosition(meta, input, length), length, Pipe.blobMask(input)); }
public static void parseSetup(TrieParserReader trieReader, Pipe<?> input) { //TODO: cofirm this field is next... int meta = Pipe.takeByteArrayMetaData(input); int length = Pipe.takeByteArrayLength(input); parseSetup(trieReader, Pipe.byteBackingArray(meta, input), Pipe.bytePosition(meta, input, length), length, Pipe.blobMask(input)); }
private void extractBytes() { Pipe.takeMsgIdx(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); length = Pipe.takeByteArrayLength(pipe); backing = Pipe.byteBackingArray(meta, pipe); mask = Pipe.blobMask(pipe); position = Pipe.bytePosition(meta, pipe, length); Pipe.confirmLowLevelWrite(pipe); Pipe.publishWrites(pipe); }
private void extractBytes() { Pipe.takeMsgIdx(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); length = Pipe.takeByteArrayLength(pipe); backing = Pipe.byteBackingArray(meta, pipe); mask = Pipe.blobMask(pipe); position = Pipe.bytePosition(meta, pipe, length); Pipe.confirmLowLevelWrite(pipe); Pipe.publishWrites(pipe); }
private void extractBytes() { Pipe.takeMsgIdx(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); length = Pipe.takeByteArrayLength(pipe); backing = Pipe.byteBackingArray(meta, pipe); mask = Pipe.blobMask(pipe); position = Pipe.bytePosition(meta, pipe, length); Pipe.confirmLowLevelWrite(pipe); Pipe.publishWrites(pipe); }
private void extractBytes() { Pipe.takeMsgIdx(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); length = Pipe.takeByteArrayLength(pipe); backing = Pipe.byteBackingArray(meta, pipe); mask = Pipe.blobMask(pipe); position = Pipe.bytePosition(meta, pipe, length); Pipe.confirmLowLevelWrite(pipe); Pipe.publishWrites(pipe); }
private void extractBytes() { Pipe.takeMsgIdx(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); length = Pipe.takeByteArrayLength(pipe); backing = Pipe.byteBackingArray(meta, pipe); mask = Pipe.blobMask(pipe); position = Pipe.bytePosition(meta, pipe, length); Pipe.confirmLowLevelWrite(pipe); Pipe.publishWrites(pipe); }