@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case 0: return super.readClassDescriptor(); case 1: Class<?> clazz = loadClass(readUTF()); return ObjectStreamClass.lookup(clazz); default: throw new StreamCorruptedException("Unexpected class descriptor type: " + type); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case 0: return super.readClassDescriptor(); case 1: Class<?> clazz = loadClass(readUTF()); return ObjectStreamClass.lookup(clazz); default: throw new StreamCorruptedException("Unexpected class descriptor type: " + type); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { ObjectStreamClass resultClassDescriptor = super.readClassDescriptor(); if (resultClassDescriptor.getName().equals( ACCESS_TOKEN_APP_ID_PAIR_SERIALIZATION_PROXY_V1_CLASS_NAME)) { resultClassDescriptor = ObjectStreamClass.lookup( AccessTokenAppIdPair.SerializationProxyV1.class); } else if (resultClassDescriptor.getName().equals( APP_EVENT_SERIALIZATION_PROXY_V1_CLASS_NAME)) { resultClassDescriptor = ObjectStreamClass.lookup( AppEvent.SerializationProxyV1.class); } return resultClassDescriptor; } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case CompactObjectOutputStream.TYPE_FAT_DESCRIPTOR: return super.readClassDescriptor(); case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR: String className = readUTF(); Class<?> clazz = classResolver.resolve(className); return ObjectStreamClass.lookupAny(clazz); default: throw new StreamCorruptedException( "Unexpected class descriptor type: " + type); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case CompactObjectOutputStream.TYPE_FAT_DESCRIPTOR: return super.readClassDescriptor(); case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR: String className = readUTF(); Class<?> clazz = classResolver.resolve(className); return ObjectStreamClass.lookupAny(clazz); default: throw new StreamCorruptedException( "Unexpected class descriptor type: " + type); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case CompactObjectOutputStream.TYPE_FAT_DESCRIPTOR: return super.readClassDescriptor(); case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR: String className = readUTF(); Class<?> clazz = classResolver.resolve(className); return ObjectStreamClass.lookupAny(clazz); default: throw new StreamCorruptedException( "Unexpected class descriptor type: " + type); } }
ObjectStreamClass ose = super.readClassDescriptor();
return super.readClassDescriptor(); case CompactObjectOutputStream.TYPE_THIN_DESCRIPTOR: String className = readUTF();
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { boolean isProxy = readBoolean(); if (isProxy) { String name = (String)readObject(); Class superClass = loader.loadClass(name); int length = readInt(); Class[] interfaces = new Class[length]; for (int i = 0; i < length; i++) { name = (String)readObject(); interfaces[i] = loader.loadClass(name); } length = readInt(); byte[] signature = new byte[length]; read(signature); ProxyFactory factory = new ProxyFactory(); // we must always use the cache and never use writeReplace when using // ProxyObjectOutputStream and ProxyObjectInputStream factory.setUseCache(true); factory.setUseWriteReplace(false); factory.setSuperclass(superClass); factory.setInterfaces(interfaces); Class proxyClass = factory.createClass(signature); return ObjectStreamClass.lookup(proxyClass); } else { return super.readClassDescriptor(); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { boolean isProxy = readBoolean(); if (isProxy) { String name = (String)readObject(); Class<?> superClass = loader.loadClass(name); int length = readInt(); Class<?>[] interfaces = new Class[length]; for (int i = 0; i < length; i++) { name = (String)readObject(); interfaces[i] = loader.loadClass(name); } length = readInt(); byte[] signature = new byte[length]; read(signature); ProxyFactory factory = new ProxyFactory(); // we must always use the cache and never use writeReplace when using // ProxyObjectOutputStream and ProxyObjectInputStream factory.setUseCache(true); factory.setUseWriteReplace(false); factory.setSuperclass(superClass); factory.setInterfaces(interfaces); Class<?> proxyClass = factory.createClass(signature); return ObjectStreamClass.lookup(proxyClass); } return super.readClassDescriptor(); }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { boolean isProxy = readBoolean(); if (isProxy) { String name = (String)readObject(); Class<?> superClass = loader.loadClass(name); int length = readInt(); Class<?>[] interfaces = new Class[length]; for (int i = 0; i < length; i++) { name = (String)readObject(); interfaces[i] = loader.loadClass(name); } length = readInt(); byte[] signature = new byte[length]; read(signature); ProxyFactory factory = new ProxyFactory(); // we must always use the cache and never use writeReplace when using // ProxyObjectOutputStream and ProxyObjectInputStream factory.setUseCache(true); factory.setUseWriteReplace(false); factory.setSuperclass(superClass); factory.setInterfaces(interfaces); Class<?> proxyClass = factory.createClass(signature); return ObjectStreamClass.lookup(proxyClass); } return super.readClassDescriptor(); }
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { boolean isProxy = readBoolean(); if (isProxy) { String name = (String)readObject(); Class superClass = loader.loadClass(name); int length = readInt(); Class[] interfaces = new Class[length]; for (int i = 0; i < length; i++) { name = (String)readObject(); interfaces[i] = loader.loadClass(name); } length = readInt(); byte[] signature = new byte[length]; read(signature); ProxyFactory factory = new ProxyFactory(); // we must always use the cache and never use writeReplace when using // ProxyObjectOutputStream and ProxyObjectInputStream factory.setUseCache(true); factory.setUseWriteReplace(false); factory.setSuperclass(superClass); factory.setInterfaces(interfaces); Class proxyClass = factory.createClass(signature); return ObjectStreamClass.lookup(proxyClass); } else { return super.readClassDescriptor(); } }
private ObjectStreamClass readEnumDescInternal() throws IOException, ClassNotFoundException { ObjectStreamClass classDesc; primitiveData = input; int oldHandle = descriptorHandle; descriptorHandle = nextHandle(); classDesc = readClassDescriptor(); registerObjectRead(classDesc, descriptorHandle, false); descriptorHandle = oldHandle; primitiveData = emptyStream; classDesc.setClass(resolveClass(classDesc)); // Consume unread class annotation data and TC_ENDBLOCKDATA discardData(); ObjectStreamClass superClass = readClassDesc(); checkedSetSuperClassDesc(classDesc, superClass); // Check SUIDs, note all SUID for Enum is 0L if (0L != classDesc.getSerialVersionUID() || 0L != superClass.getSerialVersionUID()) { throw new InvalidClassException(superClass.getName(), "Incompatible class (SUID): " + superClass + " but expected " + superClass); } byte tc = nextTC(); // discard TC_ENDBLOCKDATA after classDesc if any if (tc == TC_ENDBLOCKDATA) { // read next parent class. For enum, it may be null superClass.setSuperclass(readClassDesc()); } else { // not TC_ENDBLOCKDATA, push back for next read pushbackTC(); } return classDesc; }
int oldHandle = descriptorHandle; descriptorHandle = nextHandle(); ObjectStreamClass newClassDesc = readClassDescriptor(); registerObjectRead(newClassDesc, descriptorHandle, unshared); descriptorHandle = oldHandle;
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { int type = read(); if (type < 0) { throw new EOFException(); } switch (type) { case 0: // Primitive types return super.readClassDescriptor(); case 1: // Non-primitive types String className = readUTF(); Class<?> clazz = Class.forName(className, true, classLoader); return ObjectStreamClass.lookup(clazz); default: throw new StreamCorruptedException("Unexpected class descriptor type: " + type); } }
@Override public ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { return super.readClassDescriptor(); } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { nextIsClassName = true; return super.readClassDescriptor(); }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { ObjectStreamClass read = super.readClassDescriptor(); if(read.getName().equals( "com.cinchapi.concourse.server.storage.ByteableFunnel")) { upgrade.set(true); return ObjectStreamClass.lookup(ByteableFunnel.class); } return read; }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { ObjectStreamClass read = super.readClassDescriptor(); if (read.forClass() == null && read.getName().endsWith("Exception")) { log.warning(read.getName() + " is not present on the client classpath; substituting " + SUBSTITUTE_EXCEPTION.forClass().getSimpleName()); return SUBSTITUTE_EXCEPTION; } else { return read; } } }
@Override protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { ObjectStreamClass d = super.readClassDescriptor(); // this can be used to filter out classes System.out.println(d.getName()); return d; } };