use of it.unimi.dsi.fastutil.bytes.ByteList in project SilverKing by Morgan-Stanley.
the class SecondaryTargetSerializer method serialize.
public static byte[] serialize(Set<SecondaryTarget> specs) {
ByteList list;
list = new ByteArrayList(initialBufferSize);
for (SecondaryTarget spec : specs) {
byte[] targetBytes;
list.add((byte) spec.getType().ordinal());
targetBytes = spec.getTarget().getBytes();
list.addElements(list.size(), NumConversion.shortToBytes((short) targetBytes.length));
list.addElements(list.size(), targetBytes);
}
return list.toByteArray();
}
Aggregations