/** * 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 ); } } }
/** * 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 ); } }
/** * 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 ); } }
throw new WrappedRuntimeException( except ); throw new WrappedRuntimeException( except );
throw new WrappedRuntimeException( except );
throw new WrappedRuntimeException( except );
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recordManager.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recMgr.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recordManager.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
throw new WrappedRuntimeException( except );