@ SuppressWarnings ( "unchecked" ) public static < T > T load ( InputStream stream ) { try { ObjectInputStream inStream = ( stream instanceof ObjectInputStream ) ? ( ObjectInputStream ) stream : new ObjectInputStream ( stream ) ; T object = ( T ) inStream . readObject ( ) ; return object ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; } catch ( ClassNotFoundException cnfe ) { throw new IOError ( cnfe ) ; } }
Loads a serialized object of the specifed type from the stream . This method does not close the stream after reading