Examples of ClassLoaderObjectInputStream


Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

        if (str == null || str.length() == 0)
            return null;
        ObjectInputStream objStream = null;
        try {
            ByteArrayInputStream serialObj = new ByteArrayInputStream(decodeBytes(str));
            objStream = new ClassLoaderObjectInputStream(Thread.currentThread().getContextClassLoader(), new InflaterInputStream(serialObj));
            return objStream.readObject();
        } catch (Exception e) {
            throw new IOException("Deserialization error: " + e.getMessage(), e);
        } finally {
            IOUtils.closeQuietly(objStream);
View Full Code Here

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

        }
        ObjectInputStream in = null;
        try
        {
            // stream closed in the finally
            in = new ClassLoaderObjectInputStream(cl, inputStream);
            Object obj = in.readObject();
            if (obj instanceof DeserializationPostInitialisable)
            {
                DeserializationPostInitialisable.Implementation.init(obj, muleContext);
            }
View Full Code Here

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

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

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

  {
    // read the input stream into an object. we use the the (apache commons-io) ClassLoaderObjectInputStream
    // 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

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

  {
    // read the input stream into an object. we use the the (apache commons-io) ClassLoaderObjectInputStream
    // 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

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

    int len = input.readInt();
    byte[] ser = new byte[len];
    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

Examples of org.apache.commons.io.input.ClassLoaderObjectInputStream

  public static Object deserialize(byte[] serialized, URLClassLoader loader) {
    try {
      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

Examples of org.apache.felix.mosgi.jmx.agent.mx4j.loading.ClassLoaderObjectInputStream

      }

      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
      try
      {
         return new ClassLoaderObjectInputStream(bais, classloader);
      }
      catch (IOException x)
      {
         throw new OperationsException(x.toString());
      }
View Full Code Here

Examples of org.apache.james.util.io.ClassLoaderObjectInputStream

            if( inputStream == null )
                  throw new NullPointerException("Null input stream returned for key: " + key );

            try
            {
                final ObjectInputStream stream = new ClassLoaderObjectInputStream( classLoader, inputStream );

                if( stream == null )
                  throw new NullPointerException("Null stream returned for key: " + key );

                final Object object = stream.readObject();

                if( DEBUG )
                {
                    getLogger().debug( "returning object " + object + " for key " + key );
                }
View Full Code Here

Examples of org.apache.james.util.io.ClassLoaderObjectInputStream

            if( inputStream == null )
                  throw new NullPointerException("Null input stream returned for key: " + key );

            try
            {
                final ObjectInputStream stream = new ClassLoaderObjectInputStream( classLoader, inputStream );

                if( stream == null )
                  throw new NullPointerException("Null stream returned for key: " + key );

                final Object object = stream.readObject();

                if( DEBUG )
                {
                    getLogger().debug( "returning object " + object + " for key " + key );
                }
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.