private SessionData load ( InputStream is , String expectedId ) throws Exception { try { DataInputStream di = new DataInputStream ( is ) ; String id = di . readUTF ( ) ; // the actual id from inside the file long created = di . readLong ( ) ; long accessed = di . readLong ( ) ; long lastAccessed = di . readLong ( ) ; long expiry = di . readLong ( ) ; long maxIdle = di . readLong ( ) ; SessionData data = newSessionData ( id , created , accessed , lastAccessed , maxIdle ) ; data . setExpiryTime ( expiry ) ; data . setMaxInactiveInterval ( maxIdle ) ; // Attributes restoreAttributes ( di , di . readInt ( ) , data ) ; return data ; } catch ( Exception e ) { throw new UnreadableSessionDataException ( expectedId , e ) ; } }
Load session data from an input stream that contains session data .