コード例 #1
0
 /**
  * Uses a compatible adaptor to restore the object
  *
  * @param object Object to restore
  * @param type The type of class to try and read
  * @throws IOException
  */
 public final void readObject(Object object, Class<?> type) throws IOException {
   try {
     Adaptor.resolveAdaptor(type).read(object, this);
   } catch (AdaptorException ex) {
     throw new IOException(ex);
   }
 }
コード例 #2
0
 /**
  * Attempts to create and restore an object from the stream
  *
  * @return A new instance of an Object
  * @throws IOException
  */
 public final Object readMutableObject() throws IOException {
   try {
     return Adaptor.resolveAndReadMutable(this);
   } catch (AdaptorException ex) {
     throw new IOException(ex);
   } catch (ClassNotFoundException ex) {
     throw new IOException(ex);
   } catch (UnsupportedOperationException ex) {
     throw new IOException(ex);
   }
 }