Package java.io

Examples of java.io.InvalidClassException


      writeTo((String) obj, os);
    } else if (obj instanceof byte[]) {
      writeTo(BYTEARRAY, os);
      writeTo((byte[]) obj, os);
    } else {
      throw new InvalidClassException("Bad primitive type");
    }
  }
View Full Code Here


    case STRING:
      return readStringFrom(is);
    case BYTEARRAY:
      return readByteArrayFrom(is);
    default:
      throw new InvalidClassException("Bad primitive type");
    }
  }
View Full Code Here

        try {
            SEIFactoryImpl seiFactory =  new SEIFactoryImpl(serviceName, portQName.getLocalPart(), serviceEndpointClass, operationInfos, serviceImpl, typeInfo, location, handlerInfos, null, credentialsName);
//            seiFactory.initialize();
            return seiFactory;
        } catch (ClassNotFoundException e) {
            throw new InvalidClassException(GenericServiceEndpoint.class.getName(), "this is impossible");
        }
    }
View Full Code Here

        Class<?> primitiveType = PRIMITIVE_TYPES.get(desc.getName());
        if (primitiveType != null) {
            return primitiveType;
        }
        if (!isClassValid(desc.getName())) {
            throw new InvalidClassException("Unauthorized deserialization attempt", desc.getName());
        }
        return super.resolveClass(desc);
    }
View Full Code Here

                // What to do if it's null?
                writeObjectField(field, value);
    break;
      default:
    // XXX I18N, Logging needed.
    throw new InvalidClassException(currentClassDesc.getName());
      }
    }
View Full Code Here

  throws IOException, InvalidClassException {

      for (int i = 0; i < fields.length; i++) {
          if (fields[i].getField() == null)
    // XXX I18N, Logging needed.
        throw new InvalidClassException(cl.getName(),
            "Nonexistent field " + fields[i].getName());

      try {
    switch (fields[i].getTypeCode()) {
        case 'B':
      byte byteValue = fields[i].getField().getByte( o ) ;
      orbStream.write_octet(byteValue);
      break;
        case 'C':
      char charValue = fields[i].getField().getChar( o ) ;
      orbStream.write_wchar(charValue);
      break;
        case 'F':
      float floatValue = fields[i].getField().getFloat( o ) ;
      orbStream.write_float(floatValue);
      break;
        case 'D' :
      double doubleValue = fields[i].getField().getDouble( o ) ;
      orbStream.write_double(doubleValue);
      break;
        case 'I':
      int intValue = fields[i].getField().getInt( o ) ;
      orbStream.write_long(intValue);
      break;
        case 'J':
      long longValue = fields[i].getField().getLong( o ) ;
      orbStream.write_longlong(longValue);
      break;
        case 'S':
      short shortValue = fields[i].getField().getShort( o ) ;
      orbStream.write_short(shortValue);
      break;
        case 'Z':
      boolean booleanValue = fields[i].getField().getBoolean( o ) ;
      orbStream.write_boolean(booleanValue);
      break;
        case '[':
        case 'L':
      Object objectValue = fields[i].getField().get( o ) ;
      writeObjectField(fields[i], objectValue);
      break;
        default:
      // XXX I18N, Logging needed.
      throw new InvalidClassException(cl.getName());
    }
      } catch (IllegalAccessException exc) {
    throw wrapper.illegalFieldAccess( exc, fields[i].getName() ) ;
      }
      }
View Full Code Here

        return resolveClass( desc.getName() );
    }

    public static InvalidClassException newInvalidClassException(Class clazz,
                                                                 Throwable cause) {
        InvalidClassException exception = new InvalidClassException( clazz.getName() );
        exception.initCause( cause );
        return exception;
    }
View Full Code Here

    StringBuilder buf = new StringBuilder();
    int p = 0;
    int version = ATNDeserializer.toInt(data[p++]);
    if (version != ATNDeserializer.SERIALIZED_VERSION) {
      String reason = String.format("Could not deserialize ATN with version %d (expected %d).", version, ATNDeserializer.SERIALIZED_VERSION);
      throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason));
    }

    UUID uuid = ATNDeserializer.toUUID(data, p);
    p += 8;
    if (!uuid.equals(ATNDeserializer.SERIALIZED_UUID)) {
      String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with UUID %s (expected %s).", uuid, ATNDeserializer.SERIALIZED_UUID);
      throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason));
    }

    p++; // skip grammarType
    int maxType = ATNDeserializer.toInt(data[p++]);
    buf.append("max type ").append(maxType).append("\n");
View Full Code Here

    int p = 0;
    int version = toInt(data[p++]);
    if (version != SERIALIZED_VERSION) {
      String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with version %d (expected %d).", version, SERIALIZED_VERSION);
      throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason));
    }

    UUID uuid = toUUID(data, p);
    p += 8;
    if (!SUPPORTED_UUIDS.contains(uuid)) {
      String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with UUID %s (expected %s or a legacy UUID).", uuid, SERIALIZED_UUID);
      throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason));
    }

    boolean supportsPrecedencePredicates = isFeatureSupported(ADDED_PRECEDENCE_TRANSITIONS, uuid);
    boolean supportsLexerActions = isFeatureSupported(ADDED_LEXER_ACTIONS, uuid);
View Full Code Here

        return resolveClass( desc.getName() );
    }

    public static InvalidClassException newInvalidClassException(Class clazz,
                                                                 Throwable cause) {
        InvalidClassException exception = new InvalidClassException( clazz.getName() );
        exception.initCause( cause );
        return exception;
    }
View Full Code Here

TOP

Related Classes of java.io.InvalidClassException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.