if (metadataSize < 0 || metadataSize > MAX_CUSTOM_DATA_SIZE) {
throw new IllegalStateException("Invalid metadata size: " + metadataSize);
}
int count = 0;
DeserializeStream ds = new DeserializeStream(mmap.getAddr() + CUSTOM_DATA_OFFSET, (int) metadataSize);
while (ds.available() > 0) {
try {
Repository.provideSerializer((Serializer) ds.readObject());
} catch (IOException e) {
throw new IllegalStateException(e);
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}