earliest = Math.min(d.getTimeStamp().getTime(), earliest);
latest = Math.max(d.getTimeStamp().getTime(), latest);
}
Kryo kryo = SerializeUtil.createKryo();
b.position(MonitoringDataStorage.FIRST_RECORD_POSITION);
Output output = new Output(new ByteBufferOutputStream(b));
for (MonitoringData data : values) {
kryo.writeClassAndObject(output, data);
}
output.close();
int limit = b.position();
b.putLong(MonitoringDataStorage.EARLIEST_POSITION, earliest);
b.putLong(MonitoringDataStorage.LATEST_POSITION, latest);
b.putInt(MonitoringDataStorage.LIMIT_POSITION, limit);