public static Object deepCopy( Object o ) throws IOException, ClassNotFoundException { byte[] bytes = serializeToByteArray( o ); return deserializeFromByteArray( bytes ); }
public static Object deepCopy( Object o ) throws IOException, ClassNotFoundException { byte[] bytes = serializeToByteArray( o ); return deserializeFromByteArray( bytes ); }
public static Object deepCopy( Object o ) throws IOException, ClassNotFoundException { byte[] bytes = serializeToByteArray( o ); return deserializeFromByteArray( bytes ); }
public static byte[] toByteArray(Object obj, Indirector indirector, IndirectPolicy policy) throws NotSerializableException { try { if (policy == IndirectPolicy.DEFINITELY_INDIRECT) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); IndirectlySerialized indirect = indirector.indirectForm( obj ); return toByteArray( indirect ); } else if ( policy == IndirectPolicy.INDIRECT_ON_EXCEPTION ) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); try { return toByteArray( obj ); } catch ( NotSerializableException e ) { return toByteArray( obj, indirector, IndirectPolicy.DEFINITELY_INDIRECT ); } } else if (policy == IndirectPolicy.DEFINITELY_DIRECT) return toByteArray( obj ); else throw new InternalError("unknown indirecting policy: " + policy); } catch ( NotSerializableException e ) { throw e; } catch ( Exception e ) {
public static byte[] toByteArray(Object obj, Indirector indirector, IndirectPolicy policy) throws NotSerializableException { try { if (policy == IndirectPolicy.DEFINITELY_INDIRECT) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); IndirectlySerialized indirect = indirector.indirectForm( obj ); return toByteArray( indirect ); } else if ( policy == IndirectPolicy.INDIRECT_ON_EXCEPTION ) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); try { return toByteArray( obj ); } catch ( NotSerializableException e ) { return toByteArray( obj, indirector, IndirectPolicy.DEFINITELY_INDIRECT ); } } else if (policy == IndirectPolicy.DEFINITELY_DIRECT) return toByteArray( obj ); else throw new InternalError("unknown indirecting policy: " + policy); } catch ( NotSerializableException e ) { throw e; } catch ( Exception e ) {
public static byte[] toByteArray(Object obj, Indirector indirector, IndirectPolicy policy) throws NotSerializableException { try { if (policy == IndirectPolicy.DEFINITELY_INDIRECT) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); IndirectlySerialized indirect = indirector.indirectForm( obj ); return toByteArray( indirect ); } else if ( policy == IndirectPolicy.INDIRECT_ON_EXCEPTION ) { if (indirector == null) throw new IllegalArgumentException("null indirector is not consistent with " + policy); try { return toByteArray( obj ); } catch ( NotSerializableException e ) { return toByteArray( obj, indirector, IndirectPolicy.DEFINITELY_INDIRECT ); } } else if (policy == IndirectPolicy.DEFINITELY_DIRECT) return toByteArray( obj ); else throw new InternalError("unknown indirecting policy: " + policy); } catch ( NotSerializableException e ) { throw e; } catch ( Exception e ) {