public ObjectInputStream createObjectInputStream(InputStream in) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return new ObjectInputStreamWithLoader(in, loader); }
public JavaEEObjectInputStream(InputStream ois, ClassLoader loader, boolean resolveObject, Collection<JavaEEObjectStreamHandler> handlers) throws IOException { super(ois, loader); super.enableResolveObject(resolveObject); this.handlers = handlers; }
@Override protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { Class clazz = OSGiObjectInputOutputStreamFactoryImpl.this.resolveClass(this, desc); if (clazz == null) { clazz = super.resolveClass(desc); } return clazz; }
throw new ClassNotFoundException(cname);// malformed component = primitiveType(cname.charAt(dcount));
@Override public void _storeable_readState(InputStream is) throws IOException { ObjectInputStream ois = new ObjectInputStreamWithLoader(is, SFSBBeanState.class.getClassLoader()); try { sessionId = (Serializable) ois.readObject(); version = ois.readLong(); lastAccess = ois.readLong(); maxIdleTime = ois.readLong(); isNew = ois.readBoolean(); int len = ois.readInt(); state = new byte[len]; int index = 0; for (int remaining = len; remaining > 0;) { int count = ois.read(state, index, remaining); if (count < 0) { throw new IOException("EOF while still (" + remaining + "/" + len + ") more bytes to read"); } remaining -= count; index += count; } } catch (ClassNotFoundException cnfEx) { throw new IOException(cnfEx); } finally { try { ois.close(); } catch (Exception ex) {} } }