public class EmbeddingServerUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertVectorToByteArray(double[] v)
Encodes the double array into a byte array.
|
static int |
encodeIntIntoByteArray(byte[] bytes,
int integer,
int pos) |
public static byte[] convertVectorToByteArray(double[] v)
Encodes the double array into a byte array. The first 4 bytes are an integer telling the length of the double array in bytes (i.e. 8*length of vector length). If gzip is set, this exact information will be gzip compressed.
v - The vector to convert into a byte array.IOExceptionpublic static int encodeIntIntoByteArray(byte[] bytes,
int integer,
int pos)
Copyright © 2018 JULIE Lab, Germany. All rights reserved.