public Object deserialize ( String data ) { if ( ( data == null ) || ( data . length ( ) == 0 ) ) { return null ; } ObjectInputStream ois = null ; ByteArrayInputStream bis = null ; try { bis = new ByteArrayInputStream ( Base64 . decodeBase64 ( data . getBytes ( ) ) ) ; ois = new ObjectInputStream ( bis ) ; return ois . readObject ( ) ; } catch ( ClassNotFoundException e ) { LOGGER . error ( "Can't deserialize data from Base64" , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( IOException e ) { LOGGER . error ( "Can't deserialize data from Base64" , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( Exception e ) { LOGGER . error ( "Can't deserialize data from Base64" , e ) ; throw new IllegalArgumentException ( e ) ; } finally { try { if ( ois != null ) { ois . close ( ) ; } } catch ( Exception e ) { LOGGER . error ( "Can't close ObjetInputStream used for deserialize data from Base64" , e ) ; } } }
Deserialze base 64 encoded string data to Object .