Add support for copy to/from native memory for interop with java-lang.

This commit is contained in:
Peter Lawrey
2015-05-19 07:34:19 +01:00
parent 8e4027da08
commit 232376d2b7
@@ -31,6 +31,8 @@ public abstract class CopyingMetaBytesInterop<E, W> extends BasicCopyingMetaByte
private static final long MAX_REASONABLE_SERIALIZED_SIZE = MemoryUnit.MEGABYTES.toBytes(16L);
public static void checkMaxSizeStillReasonable(long maxSize, Exception ex) {
if (ex != null)
throw new IllegalStateException("Unable to serialize the object " + ex, ex);
if (maxSize > MAX_REASONABLE_SERIALIZED_SIZE) {
throw new IllegalStateException("We try to figure out size of objects " +
"in serialized form, but it exceeds " +