BufferObjectDataOutput out = serializationService.createObjectDataOutput(OUTPUT_SIZE);
try {
for (Map.Entry<Long, Data> entry : map.entrySet()) {
entry.getValue().writeData(out);
objectMap.put(entry.getKey(), out.toByteArray());
out.clear();
}
} catch (IOException e) {
throw new HazelcastException(e);
} finally {
IOUtil.closeResource(out);