protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class superClass = cl.getSuperclass(); Class[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class interfaze = interfaces[i]; if (interfaze != ProxyObject.class && interfaze != Proxy.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }
private byte[] serialize(Serializable data) { ObjectOutputStream oos = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); oos = new ProxyObjectOutputStream(baos); oos.writeObject(data); return baos.toByteArray(); } catch (Exception e) { throw new RuntimeException("Failed to serialize object", e); } finally { if (oos != null) { IOUtils.closeQuietly(oos); } } }
private byte[] serialize(Serializable data) { ObjectOutputStream oos = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); oos = new ProxyObjectOutputStream(baos); oos.writeObject(data); return baos.toByteArray(); } catch (Exception e) { throw new RuntimeException("Failed to serialize object", e); } finally { if (oos != null) { IOUtils.closeQuietly(oos); } } }
@Override protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class<?> cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class<?> superClass = cl.getSuperclass(); Class<?>[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class<?> interfaze = interfaces[i]; if (interfaze != ProxyObject.class && interfaze != Proxy.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class superClass = cl.getSuperclass(); Class[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class interfaze = interfaces[i]; if (interfaze != ProxyObject.class && interfaze != Proxy.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class superClass = cl.getSuperclass(); Class[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class interfaze = interfaces[i]; if (interfaze != ProxyObject.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class superClass = cl.getSuperclass(); Class[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class interfaze = interfaces[i]; if (interfaze != ProxyObject.class && interfaze != Proxy.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException { Class cl = desc.forClass(); if (ProxyFactory.isProxyClass(cl)) { writeBoolean(true); Class superClass = cl.getSuperclass(); Class[] interfaces = cl.getInterfaces(); byte[] signature = ProxyFactory.getFilterSignature(cl); String name = superClass.getName(); writeObject(name); // we don't write the marker interface ProxyObject writeInt(interfaces.length - 1); for (int i = 0; i < interfaces.length; i++) { Class interfaze = interfaces[i]; if (interfaze != ProxyObject.class && interfaze != Proxy.class) { name = interfaces[i].getName(); writeObject(name); } } writeInt(signature.length); write(signature); } else { writeBoolean(false); super.writeClassDescriptor(desc); } } }