/** * peek message and determine if it matches one of 3 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @param expected3 int message idx * @return boolean true if there is a message and it matches one of the three expected values */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2, int expected3) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2 || peekInt(pipe)==expected3); }
/** * peek message and determine if it matches one of 3 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @param expected3 int message idx * @return boolean true if there is a message and it matches one of the three expected values */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2, int expected3) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2 || peekInt(pipe)==expected3); }
/** * peek message and determine if it matches one of 3 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @param expected3 int message idx * @return boolean true if there is a message and it matches one of the three expected values */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2, int expected3) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2 || peekInt(pipe)==expected3); }
/** * peek message and determine if it matches one of 2 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @return boolean true if there is a message and it matches one of the two expected values. */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2); }
/** * peek message and determine if it matches one of 2 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @return boolean true if there is a message and it matches one of the two expected values. */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2); }
/** * peek message and determine if it matches one of 2 potential values * @param pipe Pipe source * @param expected1 int message idx * @param expected2 int message idx * @return boolean true if there is a message and it matches one of the two expected values. */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected1, int expected2) { return (Pipe.contentRemaining(pipe)>0) && (peekInt(pipe)==expected1 || peekInt(pipe)==expected2); }
/** * peek message and determine if it does not match the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message but it is not the expected value */ public static <S extends MessageSchema<S>> boolean peekNotMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)!=expected; }
/** * peek message and determine if it matches the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message and if it matches expected */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)==expected; }
/** * peek message and determine if it matches the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message and if it matches expected */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)==expected; }
/** * peek message and determine if it does not match the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message but it is not the expected value */ public static <S extends MessageSchema<S>> boolean peekNotMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)!=expected; }
/** * peek UTF8 text at this relative offset from where the cursor is upon call * @param pipe Pipe source * @param offset int relative position of field * @param target Appendable destination for text * @return Appendable target */ public static <S extends MessageSchema<S>, A extends Appendable> A peekUTF8(Pipe<S> pipe, int offset, A target) { assert((Pipe.contentRemaining(pipe)>0)) : "results would not be repeatable"; return readUTF8(pipe, target, peekInt(pipe,offset),peekInt(pipe,offset+1)); }
/** * peek message and determine if it matches the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message and if it matches expected */ public static <S extends MessageSchema<S>> boolean peekMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)==expected; }
/** * peek UTF8 text at this relative offset from where the cursor is upon call * @param pipe Pipe source * @param offset int relative position of field * @param target Appendable destination for text * @return Appendable target */ public static <S extends MessageSchema<S>, A extends Appendable> A peekUTF8(Pipe<S> pipe, int offset, A target) { assert((Pipe.contentRemaining(pipe)>0)) : "results would not be repeatable"; return readUTF8(pipe, target, peekInt(pipe,offset),peekInt(pipe,offset+1)); }
/** * peek message and determine if it does not match the expected value * @param pipe Pipe source * @param expected int message idx * @return boolean true if there is a message but it is not the expected value */ public static <S extends MessageSchema<S>> boolean peekNotMsg(Pipe<S> pipe, int expected) { return (Pipe.contentRemaining(pipe)>0) && peekInt(pipe)!=expected; }
/** * peek UTF8 text at this relative offset from where the cursor is upon call * @param pipe Pipe source * @param offset int relative position of field * @param target Appendable destination for text * @return Appendable target */ public static <S extends MessageSchema<S>, A extends Appendable> A peekUTF8(Pipe<S> pipe, int offset, A target) { assert((Pipe.contentRemaining(pipe)>0)) : "results would not be repeatable"; return readUTF8(pipe, target, peekInt(pipe,offset),peekInt(pipe,offset+1)); }
public int peekLowLevelAPIField(int offset) { int meta = Pipe.peekInt(this.pipe, offset); this.length = Math.max(0, Pipe.peekInt(this.pipe, offset+1)); this.bytesLowBound = this.position = Pipe.convertToPosition(meta, this.pipe); 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; }
public int peekLowLevelAPIField(int offset) { int meta = Pipe.peekInt(this.pipe, offset); this.isStructured = (0!=(Pipe.STRUCTURED_POS_MASK&meta)); this.length = Math.max(0, Pipe.peekInt(this.pipe, offset+1)); this.bytesLowBound = this.position = Pipe.convertToPosition(meta, this.pipe); 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; }
public static void appendNextFieldToReader(LittleEndianDataInputBlobReader reader, Pipe<RawDataSchema> targetPipe) { while (Pipe.hasContentToRead(targetPipe) && Pipe.peekInt(targetPipe) >=0) { Pipe.takeMsgIdx(targetPipe); accumLowLevelAPIField(reader); Pipe.readNextWithoutReleasingReadLock(targetPipe); Pipe.confirmLowLevelRead(targetPipe, Pipe.sizeOf(targetPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); } }
public static void appendNextFieldToReader(LittleEndianDataInputBlobReader reader, Pipe<RawDataSchema> targetPipe) { while (Pipe.hasContentToRead(targetPipe) && Pipe.peekInt(targetPipe) >=0) { Pipe.takeMsgIdx(targetPipe); accumLowLevelAPIField(reader); Pipe.readNextWithoutReleasingReadLock(targetPipe); Pipe.confirmLowLevelRead(targetPipe, Pipe.sizeOf(targetPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); } }
public static void appendNextFieldToReader(LittleEndianDataInputBlobReader reader, Pipe<RawDataSchema> targetPipe) { while (Pipe.hasContentToRead(targetPipe) && Pipe.peekInt(targetPipe) >=0) { Pipe.takeMsgIdx(targetPipe); accumLowLevelAPIField(reader); Pipe.readNextWithoutReleasingReadLock(targetPipe); Pipe.confirmLowLevelRead(targetPipe, Pipe.sizeOf(targetPipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)); } }