@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ctx.getAlias(ClassNameUtil.decodeClassName(ctx)); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Collection<Object> v = (Collection<Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) v.add(ctx.readObject()); return v; }
@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ctx.getAlias(ClassNameUtil.decodeClassName(ctx)); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Collection<Object> v = (Collection<Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) v.add(ctx.readObject()); return v; }
@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ctx.getAlias(ClassNameUtil.decodeClassName(ctx)); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Collection<Object> v = (Collection<Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) v.add(ctx.readObject()); return v; }
@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ClassNameUtil.decodeClassName(ctx); className = ctx.getAlias(className); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Map<Object, Object> v = (Map<Object, Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) { Object key = ctx.readObject(); Object value = ctx.readObject(); v.put(key, value); } return v; }
Object replacement = desc.invokeWriteReplaceMethod(v); if (replacement == null) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned null"); if (replacement.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned an instance of the same class"); desc.getCls() + ".writeReplace() method returned an object that has no readResolve() method: " + (replacementDesc == null ? "null" : replacementDesc.getCls()) );
@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ClassNameUtil.decodeClassName(ctx); className = ctx.getAlias(className); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Map<Object, Object> v = (Map<Object, Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) { Object key = ctx.readObject(); Object value = ctx.readObject(); v.put(key, value); } return v; }
@Override public Object decode(InputContext ctx, int parameterizedJmfType) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException { int indexOrLength = IntegerUtil.decodeInteger(ctx, (parameterizedJmfType >>> INDEX_OR_LENGTH_BYTE_COUNT_OFFSET) & 0x03); if ((parameterizedJmfType & 0x80) != 0) return ctx.getObject(indexOrLength); String className = ClassNameUtil.decodeClassName(ctx); className = ctx.getAlias(className); ClassDescriptor desc = ctx.getClassDescriptor(className); Class<?> cls = desc.getCls(); if (!Serializable.class.isAssignableFrom(cls)) throw new NotSerializableException(cls.getName()); @SuppressWarnings("unchecked") Map<Object, Object> v = (Map<Object, Object>)desc.newInstance(); ctx.addToObjects(v); for (int index = 0; index < indexOrLength; index++) { Object key = ctx.readObject(); Object value = ctx.readObject(); v.put(key, value); } return v; }
Object replacement = desc.invokeWriteReplaceMethod(v); if (replacement == null) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned null"); if (replacement.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned an instance of the same class"); desc.getCls() + ".writeReplace() method returned an object that has no readResolve() method: " + (replacementDesc == null ? "null" : replacementDesc.getCls()) );
Object replacement = desc.invokeWriteReplaceMethod(v); if (replacement == null) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned null"); if (replacement.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".writeReplace() method returned an instance of the same class"); desc.getCls() + ".writeReplace() method returned an object that has no readResolve() method: " + (replacementDesc == null ? "null" : replacementDesc.getCls()) );
Class<?> cls = desc.getCls(); Object resolved = desc.invokeReadResolveMethod(v); if (resolved == null) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned null"); if (resolved.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned an instance of the same class"); desc.getCls() + ".readResolve() method returned an object that has no writeReplace() method: " + (resolvedDesc == null ? "null" : resolvedDesc.getCls()) );
Class<?> cls = desc.getCls(); Object resolved = desc.invokeReadResolveMethod(v); if (resolved == null) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned null"); if (resolved.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned an instance of the same class"); desc.getCls() + ".readResolve() method returned an object that has no writeReplace() method: " + (resolvedDesc == null ? "null" : resolvedDesc.getCls()) );
Class<?> cls = desc.getCls(); Object resolved = desc.invokeReadResolveMethod(v); if (resolved == null) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned null"); if (resolved.getClass() == v.getClass()) throw new JMFEncodingException(desc.getCls() + ".readResolve() method returned an instance of the same class"); desc.getCls() + ".readResolve() method returned an object that has no writeReplace() method: " + (resolvedDesc == null ? "null" : resolvedDesc.getCls()) );