All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javanut.pronghorn.pipe.SchemalessPipe Maven / Gradle / Ivy

Go to download

Ring buffer based queuing utility for applications that require high performance and/or a small footprint. Well suited for embedded and stream based processing.

There is a newer version: 1.1.27
Show newest version
package com.javanut.pronghorn.pipe;

public class SchemalessPipe {

	public static void writeFloat(Pipe p, float value) {
		Pipe.addIntValue(Float.floatToIntBits(value),p);
	}
	
	public static float readFloat(Pipe p) {
		return Float.intBitsToFloat(Pipe.takeInt(p));
	}
	
	public static void writeInt(Pipe p, int value) {
		Pipe.addIntValue(value,p);
	}
	
	public static int readInt(Pipe p) {
		return Pipe.takeInt(p);
	}
	
	public static void writeDouble(Pipe p, double value) {
		Pipe.addLongValue(Double.doubleToLongBits(value),p);
	}
	
	public static double readDouble(Pipe p) {
		return Double.longBitsToDouble(Pipe.takeLong(p));
	}
	
	public static void writeLong(Pipe p, long value) {
		Pipe.addLongValue(value,p);
	}
	
	public static long readLong(Pipe p) {
		return Pipe.takeLong(p);
	}
	
	public static void publishWrites(Pipe p) {
		Pipe.publishWritesBatched(p);
	}
	
	public static void releaseReads(Pipe p) {
		Pipe.releaseReadsBatched(p);
	}
	
	public static int contentRemaining(Pipe p) {
		return Pipe.contentRemaining(p);
	}
	
	public static int roomRemaining(Pipe p) {
		return p.sizeOfSlabRing - Pipe.contentRemaining(p);
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy