Package org.apache.commons.io.input

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream.readObject()


        {
            ClassLoaderObjectInputStream classLoaderIS = new ClassLoaderObjectInputStream(this.getClassLoader(),
                is);
            try
            {
                return classLoaderIS.readObject();
            }
            catch (ClassNotFoundException e)
            {
                logger.warn(e.getMessage());
                IOException iox = new IOException();
View Full Code Here


        {
            ClassLoaderObjectInputStream classLoaderIS = new ClassLoaderObjectInputStream(this.getClassLoader(),
                is);
            try
            {
                return classLoaderIS.readObject();
            }
            catch (ClassNotFoundException e)
            {
                logger.warn(e.getMessage());
                IOException iox = new IOException();
View Full Code Here

    // to read the object because we need to be able to use the same class loader that loaded the class in
    // the first place (for example, the RestfulClassLoader).
    T object;
    try( final ClassLoaderObjectInputStream in = new ClassLoaderObjectInputStream( clazz.getClassLoader(), input ) )
    {
      object = clazz.cast( in.readObject() );
    }
    catch( IOException | ClassNotFoundException e )
    {
      final StringBuilder message = new StringBuilder();
      message.append( "Unable to serialize object to output stream:" ).append( Constants.NEW_LINE );
View Full Code Here

    // to read the object because we need to be able to use the same class loader that loaded the class in
    // the first place (for example, the RestfulClassLoader).
    T object;
    try( final ClassLoaderObjectInputStream in = new ClassLoaderObjectInputStream( clazz.getClassLoader(), input ) )
    {
      object = clazz.cast( in.readObject() );
    }
    catch( IOException | ClassNotFoundException e )
    {
      final StringBuilder message = new StringBuilder();
      message.append( "Unable to serialize object to output stream:" ).append( Constants.NEW_LINE );
View Full Code Here

    input.readBytes(ser);
    ByteArrayInputStream bis = new ByteArrayInputStream(ser);
    try {
      ClassLoaderObjectInputStream ois = new ClassLoaderObjectInputStream(
          kryo.getClassLoader(), bis);
      return ois.readObject();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
}
View Full Code Here

      ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
      Object ret = null;
      if (loader != null) {
        ClassLoaderObjectInputStream cis = new ClassLoaderObjectInputStream(
            loader, bis);
        ret = cis.readObject();
        cis.close();
      } else {
        ObjectInputStream ois = new ObjectInputStream(bis);
        ret = ois.readObject();
        ois.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.