Package de.julielab.ipc.javabridge
Class ResultDecoders
- java.lang.Object
-
- de.julielab.ipc.javabridge.ResultDecoders
-
public class ResultDecoders extends java.lang.ObjectThis class offers conversion functions from a byte[] to some encoded data structure therein. They are to be used in aStream.map(Function)call to the stream returned byStdioBridge.receive()or one of the sendAndReceive() methods.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Function<byte[],double[][]>decodeVectorsThis decode converts a byte array into an array of double vectors.
-
Constructor Summary
Constructors Constructor Description ResultDecoders()
-
-
-
Field Detail
-
decodeVectors
public static java.util.function.Function<byte[],double[][]> decodeVectors
This decode converts a byte array into an array of double vectors. The format of the byte array is required to look the following:- The first 4 bytes must represent an integer that indicates the number of vectors (double arrays) returned
- The bytes 5 to 8 must represent an integer that indicates the length of each vector (the length must be uniform)
- The rest of the bytes must represent doubles that fit in number to the above described dimensions
-
-