private void restoreAttributes ( InputStream is , int size , SessionData data ) throws Exception { if ( size > 0 ) { // input stream should not be closed here Map < String , Object > attributes = new HashMap <> ( ) ; ObjectInputStream ois = new CustomObjectInputStream ( is ) ; for ( int i = 0 ; i < size ; i ++ ) { String key = ois . readUTF ( ) ; Object value = ois . readObject ( ) ; attributes . put ( key , value ) ; } data . putAllAttributes ( attributes ) ; } }
Load attributes from an input stream that contains session data .