public Object get() throws IOException, ClassNotFoundException { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); JBossObjectInputStream ois = new JBossObjectInputStream(bais); try { return ois.readObject(); } finally { ois.close(); bais.close(); } }
protected void readStreamHeader() throws IOException, StreamCorruptedException { checkSignature(is); }
public ClassLoader getClassLoader() { return super.getClassLoader(); }
public Object deserialize(Object target) throws Exception{ SerializableWrapper wrapper = (SerializableWrapper)target; byte[] payload = wrapper.getPayload(); ByteArrayInputStream bais = new ByteArrayInputStream(payload); ObjectInputStream ois = new ObjectInputStream(bais); JBossObjectInputStream jbis = new JBossObjectInputStream(ois); Object result = jbis.readObject(); return result; } public void serialize(final Object[] targets) throws Exception
private JBossLogReaderInput(InputStream is) { try { in = new JBossObjectInputStream(is); } catch (IOException e) { throw Throwables.propagate(e); } }
@Override public Object readObject() throws IOException { try { Object result = in.readObject(); return result; } catch (ClassNotFoundException e) { throw Throwables.propagate(e); } } }
public void setClassLoader(ClassLoader classLoader) { if (container!=null) { container.getCache().setLoader(classLoader); } super.setClassLoader(classLoader); }
public Object readUnshared() throws IOException, ClassNotFoundException { return readObjectOverride(); }
public Class resolveClass(String name) throws ClassNotFoundException { if (constructorObjectStreamClass!=null) { try { ObjectStreamClass streamClass = (ObjectStreamClass)constructorObjectStreamClass.newInstance(ClassMetaConsts.EMPTY_OBJECT_ARRAY); setNameField.set(streamClass,name); return JBossObjectInputStream.this.resolveClass(streamClass); } catch (Exception e) { e.printStackTrace(); return null; } } return null; }
public static Object deserialize(byte[] data, ClassLoader classLoader) { ObjectInputStream ois = null; try { try{ //TODO fixes for support old reports ois= new JBossObjectInputStream(new ByteArrayInputStream(data), classLoader); } catch (IOException e){ //data stored not with JBoss ois=new ClassLoaderObjectInputStream(classLoader, new ByteArrayInputStream(data)); } return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } finally { try { Closeables.close(ois, true); } catch (IOException e) { log.warn("IOException should not have been thrown.", e); } } }
public void setClassLoader(ClassLoader classLoader) { if (container!=null) { container.getCache().setLoader(classLoader); } super.setClassLoader(classLoader); }
public Object readUnshared() throws IOException, ClassNotFoundException { return readObjectOverride(); }
public Class resolveClass(String name) throws ClassNotFoundException { if (constructorObjectStreamClass!=null) { try { ObjectStreamClass streamClass = (ObjectStreamClass)constructorObjectStreamClass.newInstance(ClassMetaConsts.EMPTY_OBJECT_ARRAY); setNameField.set(streamClass,name); return JBossObjectInputStream.this.resolveClass(streamClass); } catch (Exception e) { e.printStackTrace(); return null; } } return null; }
public Object get() throws IOException, ClassNotFoundException { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); JBossObjectInputStream ois = new JBossObjectInputStream(bais); try { return ois.readObject(); } finally { ois.close(); bais.close(); } }
public ObjectInputStream createInput(InputStream input, ClassLoader loader) throws IOException { if (trace) { log.trace(this + " creating JBossObjectInputStream"); } return new JBossObjectInputStream(input, loader, new StringUtilBuffer(10024, 10024)); }
((JBossObjectInputStream) inputStream).setClassLoader(customClassLoader); objInputStream = (ObjectInputStream) inputStream;
public ClassLoader getClassLoader() { return super.getClassLoader(); }
/** In case of InputStream is null, the only method that can be used on this class is smartClone */ public JBossObjectInputStream(InputStream is, ClassLoader loader,StringUtilBuffer buffer) throws IOException { super(); this.buffer=buffer; if (is!=null) { checkSignature(is); this.is=is; if (is instanceof DataInputStream) { dis = (DataInputStream)is; } else { dis = new DataInputStream(is); } } this.classLoader =loader; }
in = new JBossObjectInputStream(new BufferedInputStream(fis)); try
protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { return Class.forName(desc.getName(),false,getClassLoader()); }