sclass CompressToInterpolatedDoubleArray { // raw data to compress (integers) int[] data; // output InterpolatedDoubleArray result; // internal new IntBuffer indices; new DoubleBuffer values; *(int[] *data) {} InterpolatedDoubleArray get() { ret result = new InterpolatedDoubleArray(indices.toArray(), values.toArray()); } }