com.javanut.pronghorn.pipe.FragmentReader 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 FragmentReader {
public static > int readI(Pipe pipe) {
int msgIdx = Pipe.takeMsgIdx(pipe);
assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size";
int value = Pipe.takeInt(pipe);
Pipe.confirmLowLevelRead(pipe, 3);
Pipe.releaseReadLock(pipe);
return value;
}
public static > long readL(Pipe pipe) {
int msgIdx = Pipe.takeMsgIdx(pipe);
assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size";
long value = Pipe.takeLong(pipe);
Pipe.confirmLowLevelRead(pipe, 3);
Pipe.releaseReadLock(pipe);
return value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy