/** * Serialize the content of an object into a byte array. * * @param obj Object to serialize * @return a byte array representing the object's state */ public byte[] serialize( Object obj ) throws IOException { return Serialization.serialize( obj ); }
case NORMAL:ret= deserializeNormal(is);break; case BOOLEAN_TRUE:ret= true;break; case BOOLEAN_FALSE:ret= false;break; case DOUBLE_SHORT:ret= Double.valueOf(is.readShort());break; case DOUBLE_FULL:ret= Double.valueOf(is.readDouble());break; case BLOCKIO:ret= deserializeBlockIo(is);break; case STOREREFERENCE:ret= deserializeStoreReference(is);break; case STRING_255:ret= deserializeString256Smaller(is);break; case STRING:ret= deserializeString(is);break; case STRING_EMPTY:ret= "";break; case ARRAYLIST_255:ret= deserializeArrayList256Smaller(is);break; case ARRAYLIST:ret= deserializeArrayList(is);break; case ARRAYLIST_PACKED_LONG:ret= deserializeArrayListPackedLong(is);break; case ARRAY_OBJECT_255:ret= deserializeArrayObject256Smaller(is);break; case ARRAY_OBJECT:ret= deserializeArrayObject(is);break; case ARRAY_OBJECT_PACKED_LONG:ret= deserializeArrayObjectPackedLong(is);break; case LINKEDLIST_255:ret= deserializeLinkedList256Smaller(is);break; case LINKEDLIST:ret= deserializeLinkedList(is);break; case TREESET_255:ret= deserializeTreeSet256Smaller(is);break; case TREESET:ret= deserializeTreeSet(is);break; case HASHSET_255:ret= deserializeHashSet256Smaller(is);break; case HASHSET:ret= deserializeHashSet(is);break; case LINKEDHASHSET_255:ret= deserializeLinkedHashSet256Smaller(is);break; case LINKEDHASHSET:ret= deserializeLinkedHashSet(is);break; case VECTOR_255:ret= deserializeVector256Smaller(is);break; case VECTOR:ret= deserializeVector(is);break; case TREEMAP_255:ret= deserializeTreeMap256Smaller(is);break; case TREEMAP:ret= deserializeTreeMap(is);break;
/** * De-serialize the content of an object from a byte array. * * @param serialized Byte array representation of the object * @return de-serialized object */ public Object deserialize( byte[] serialized ) throws IOException { try { return Serialization.deserialize( serialized ); } catch ( ClassNotFoundException except ) { throw new WrappedRuntimeException( except ); } } }
/** * De-serialize the content of an object from a byte array. * * @param serialized Byte array representation of the object * @return de-serialized object */ public Object deserialize( byte[] serialized ) throws IOException { try { return Serialization.deserialize( serialized ); } catch ( ClassNotFoundException except ) { throw new WrappedRuntimeException( except ); } } }
/** * De-serialize the content of an object from a byte array. * * @param serialized Byte array representation of the object * @return de-serialized object */ public Object deserialize( byte[] serialized ) throws IOException { try { return Serialization.deserialize( serialized ); } catch ( ClassNotFoundException except ) { throw new WrappedRuntimeException( except ); } } }
/** * Serialize the content of an object into a byte array. * * @param obj Object to serialize * @return a byte array representing the object's state */ public byte[] serialize( Object obj ) throws IOException { return Serialization.serialize( obj ); }
/** * Compare two objects. * * @param obj1 First object * @param obj2 Second object * @return 1 if obj1 > obj2, 0 if obj1 == obj2, -1 if obj1 < obj2 */ public int compare( Object obj1, Object obj2 ) { if ( obj1 == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) ); } if ( obj2 == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) ); } try { obj1 = Serialization.deserialize( (byte[]) obj1 ); obj2 = Serialization.deserialize( (byte[]) obj2 ); return _comparator.compare( obj1, obj2 ); } catch ( IOException except ) { throw new WrappedRuntimeException( except ); } catch ( ClassNotFoundException except ) { throw new WrappedRuntimeException( except ); } }
/** * Serialize the content of an object into a byte array. * * @param obj Object to serialize * @return a byte array representing the object's state */ public byte[] serialize( Object obj ) throws IOException { return Serialization.serialize( obj ); }
/** * Compare two objects. * * @param obj1 First object * @param obj2 Second object * @return 1 if obj1 > obj2, 0 if obj1 == obj2, -1 if obj1 < obj2 */ public int compare( Object obj1, Object obj2 ) { if ( obj1 == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) ); } if ( obj2 == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) ); } try { obj1 = Serialization.deserialize( (byte[]) obj1 ); obj2 = Serialization.deserialize( (byte[]) obj2 ); return _comparator.compare( obj1, obj2 ); } catch ( IOException except ) { throw new WrappedRuntimeException( except ); } catch ( ClassNotFoundException except ) { throw new WrappedRuntimeException( except ); } }
obj1 = Serialization.deserialize( ( byte[] ) obj1 ); obj2 = Serialization.deserialize( ( byte[] ) obj2 );