1 5 package org.h2.value; 6 7 import org.h2.engine.Constants; 8 9 public class ValueJavaObject extends ValueBytesBase { 10 11 private static final ValueJavaObject EMPTY = new ValueJavaObject(new byte[0]); 12 13 protected ValueJavaObject(byte[] v) { 14 super(v); 15 } 16 17 public static ValueJavaObject getNoCopy(byte[] b) { 18 if (b.length == 0) { 19 return EMPTY; 20 } 21 ValueJavaObject obj = new ValueJavaObject(b); 22 if (b.length > Constants.OBJECT_CACHE_MAX_PER_ELEMENT_SIZE) { 23 return obj; 24 } 25 return (ValueJavaObject) Value.cache(obj); 26 } 27 28 public int getType() { 29 return Value.JAVA_OBJECT; 30 } 31 32 } 33 | Popular Tags |