code: 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);
          }
      }
docs: Load session data from an input stream that contains session data.
  
  @param is the input stream containing session data
  @param expectedId the id we've been told to load
  @return the session data
  @throws Exception if the session data could not be read from the file