/** * {@inheritDoc} */ @Override public byte[] serializeAttributes( final MemcachedBackupSession session, final ConcurrentMap<String, Object> attributes ) { if ( attributes == null ) { throw new NullPointerException( "Can't serialize null" ); } ByteArrayOutputStream bos = null; ObjectOutputStream oos = null; try { bos = new ByteArrayOutputStream(); oos = new ObjectOutputStream( bos ); writeAttributes( session, attributes, oos ); return bos.toByteArray(); } catch ( final IOException e ) { throw new IllegalArgumentException( "Non-serializable object", e ); } finally { closeSilently( bos ); closeSilently( oos ); } }
throw new TranscoderDeserializationException( "Caught IOException decoding data", e ); } finally { closeSilently( bis ); closeSilently( ois );
/** * {@inheritDoc} */ @Override public byte[] serializeAttributes( final MemcachedBackupSession session, final ConcurrentMap<String, Object> attributes ) { if ( attributes == null ) { throw new NullPointerException( "Can't serialize null" ); } ByteArrayOutputStream bos = null; ObjectOutputStream oos = null; try { bos = new ByteArrayOutputStream(); oos = new ObjectOutputStream( bos ); writeAttributes( session, attributes, oos ); return bos.toByteArray(); } catch ( final IOException e ) { throw new IllegalArgumentException( "Non-serializable object", e ); } finally { closeSilently( bos ); closeSilently( oos ); } }
throw new TranscoderDeserializationException( "Caught IOException decoding data", e ); } finally { closeSilently( bis ); closeSilently( ois );