TypedBytesInput in =
new TypedBytesInput(
new DataInputStream(
new ByteArrayInputStream(bytes.getBytes())));
Type t = in.readType();
if (t == Type.VECTOR || t == Type.LIST) {
if (t == Type.VECTOR) {
ArrayList<Double> d = new ArrayList<Double>();
int len = in.readVectorHeader();
for (int i=0; i<len; ++i) {
Type et = in.readType();
d.add(new Double(readDouble(in, et)));
}
return doubleArrayListToArray(d);
} else {
ArrayList<Double> d = new ArrayList<Double>();
while (true) {
Type et = in.readType();
if (et == Type.MARKER) {
break;
}
d.add(new Double(readDouble(in, et)));
}