com.javanut.pronghorn.pipe.RawDataSchemaUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pronghorn-pipes Show documentation
Show all versions of pronghorn-pipes Show documentation
Ring buffer based queuing utility for applications that require high performance and/or a small
footprint. Well suited for embedded and stream based processing.
package com.javanut.pronghorn.pipe;
public class RawDataSchemaUtil {
public static boolean accumulateInputStream(Pipe pipe) {
int msgIdx = Pipe.takeMsgIdx(pipe);
boolean isEnd;
if (RawDataSchema.MSG_CHUNKEDSTREAM_1 == msgIdx) {
isEnd = DataInputBlobReader.accumLowLevelAPIField(Pipe.inputStream(pipe))<=0;
Pipe.confirmLowLevelRead(pipe, Pipe.sizeOf(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1));
} else {
//eof
isEnd = true;
Pipe.confirmLowLevelRead(pipe, Pipe.EOF_SIZE);
}
Pipe.readNextWithoutReleasingReadLock(pipe);
return isEnd;
}
public static void releaseConsumed(Pipe pipe, ChannelReader reader, int startingAvail) {
//release the number of bytes we consumed
Pipe.releasePendingAsReadLock(pipe, startingAvail-reader.available());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy