Java Code Examples for java.io.ObjectInput#readUTF()

The following examples show how to use java.io.ObjectInput#readUTF() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void readExternal(ObjectInput in) throws IOException,
                                                ClassNotFoundException {
    index = in.readInt();
    valueType = (ValueType) in.readObject();
    String clsName = in.readUTF();

    if (!clsName.isEmpty()) {
        try {
            fieldType = in instanceof DroolsObjectInput ?
                        ClassUtils.getClassFromName( clsName, false, ( (DroolsObjectInput) in ).getClassLoader() ) :
                        ClassUtils.getClassFromName( clsName );
        } catch (ClassNotFoundException e) {
            throw new RuntimeException( e );
        }
    }
}
 
Example 2
public void readExternal( ObjectInput in ) throws IOException,
                                          ClassNotFoundException {
    name = in.readUTF();
    expression = in.readUTF();

    globalIdentifiers = (String[]) in.readObject();
    operators = (EvaluatorWrapper[]) in.readObject();

    previousDeclarations = (Declaration[]) in.readObject();
    localDeclarations = (Declaration[]) in.readObject();
    otherIdentifiers = (String[]) in.readObject();

    inputIdentifiers = (String[]) in.readObject();
    inputTypes = (String[]) in.readObject();

    strictMode = in.readBoolean();
    
    readLocalsFromTuple = in.readBoolean();
}
 
Example 3
Source Project: Time4A   File: HijriCalendar.java    License: Apache License 2.0 6 votes vote down vote up
private HijriCalendar readHijri(ObjectInput in) throws IOException {

            String variant = in.readUTF();
            String version = in.readUTF();

            if (!HijriCalendar.getVersion(variant).equals(version)) {
                throw new InvalidObjectException(
                        "Hijri calendar object with different data version not supported: "
                                + variant
                                + "/"
                                + version);
            }

            int year = in.readInt();
            int month = in.readByte();
            int dom = in.readByte();
            return HijriCalendar.of(variant, year, month, dom);

        }
 
Example 4
Source Project: library   File: ReconfigureReply.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    newView = (View) in.readObject();
    this.lastExecConsId = in.readInt();
    this.execLeader = in.readInt();
    joinSet = new String[in.readInt()];
    for(int i = 0; i < joinSet.length;i++){
        joinSet[i] = in.readUTF();
    }
}
 
Example 5
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   String url = in.readUTF();
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   ServerLocatorParser locatorParser = new ServerLocatorParser();
   try {
      URI uri = new URI(url);
      serverLocator = locatorParser.newObject(uri, null);
      parser.populateObject(uri, this);
   } catch (Exception e) {
      InvalidObjectException ex = new InvalidObjectException(e.getMessage());
      ex.initCause(e);
      throw ex;
   }
}
 
Example 6
Source Project: Bytecoder   File: MimeType.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * The object implements the readExternal method to restore its contents by
     * calling the methods of DataInput for primitive types and readObject for
     * objects, strings and arrays. The readExternal method must read the values
     * in the same sequence and with the same types as were written by
     * writeExternal.
     *
     * @throws ClassNotFoundException If the class for an object being restored
     *         cannot be found
     */
    public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
        String s = in.readUTF();
        if (s == null || s.length() == 0) { // long mime type
            byte[] ba = new byte[in.readInt()];
            in.readFully(ba);
            s = new String(ba);
        }
        try {
            parse(s);
        } catch(MimeTypeParseException e) {
            throw new IOException(e.toString());
        }
    }
 
Example 7
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
	name_ = in.readUTF();
	defaultSummary_ = in.readBoolean();
	int defCount = in.readInt();
	for (int i = 0; i < defCount; i++) {
		itemDefinitionKeys_.add(in.readUTF());
	}
	int labelCount = in.readInt();
	for (int i = 0; i < labelCount; i++) {
		String key = in.readUTF();
		String value = in.readUTF();
		overrideLabels_.put(key, value);
	}
}
 
Example 8
Source Project: tomee   File: EJBMetaDataImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    homeClass = (Class) in.readObject();
    remoteClass = (Class) in.readObject();
    keyClass = (Class) in.readObject();
    ejbHomeProxy = (EJBHome) in.readObject();
    type = in.readByte();
    deploymentID = in.readUTF();
    deploymentCode = in.readShort();

    for (int i = in.readShort(); i > 0; i--) {
        businessClasses.add((Class) in.readObject());
    }
    if (businessClasses.size() > 0) {
        primaryKey = in.readObject();
    }
    if (version > 2) {
        mainInterface = (Class) in.readObject();
    }
    if (version > 1) {
        final byte typeIndex = in.readByte();
        interfaceType = InterfaceType.values()[typeIndex];
    }
    for (int i = in.readInt(); i > 0; i--) {
        asynchronousMethods.add((String) in.readObject());
    }

    final boolean hasProperties = in.readBoolean();
    if (hasProperties) {
        final int bufferLength = in.readInt();
        final byte[] buffer = new byte[bufferLength];
        in.read(buffer);
        final ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        properties.load(bais);
    }
}
 
Example 9
Source Project: org.openntf.domino   File: DataLocation.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(final ObjectInput input) throws IOException, ClassNotFoundException {
	nc_ = (NoteCoordinate) input.readObject();
	securityType_ = input.readInt();
	begins_ = input.readInt();
	ends_ = input.readInt();
	itemName_ = input.readUTF();
	attachmentName_ = input.readUTF();
}
 
Example 10
Source Project: openjdk-8   File: MimeType.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * The object implements the readExternal method to restore its
     * contents by calling the methods of DataInput for primitive
     * types and readObject for objects, strings and arrays.  The
     * readExternal method must read the values in the same sequence
     * and with the same types as were written by writeExternal.
     * @exception ClassNotFoundException If the class for an object being
     *              restored cannot be found.
     */
    public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
        String s = in.readUTF();
        if (s == null || s.length() == 0) { // long mime type
            byte[] ba = new byte[in.readInt()];
            in.readFully(ba);
            s = new String(ba);
        }
        try {
            parse(s);
        } catch(MimeTypeParseException e) {
            throw new IOException(e.toString());
        }
    }
 
Example 11
Source Project: tomcatsrc   File: MethodExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 12
@Override
public void readExternal(ObjectInput in) throws IOException,
    ClassNotFoundException {
  System.out.println("VersionedHeader.readExternal invoked with " + in);
  if (in instanceof VersionedObjectInput) {
    this.serializedVersion = ((VersionedObjectInput)in).getVersion();
  } else {
    this.serializedVersion = Version.CURRENT;
  }
  in.readBoolean();
  in.readUTF();
}
 
Example 13
Source Project: incubator-hivemall   File: MixMessage.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    byte id = in.readByte();
    this.event = MixEventName.resolve(id);
    this.feature = in.readObject();
    this.weight = in.readFloat();
    this.covariance = in.readFloat();
    this.clock = in.readShort();
    this.deltaUpdates = in.readInt();
    this.cancelRequest = in.readBoolean();
    boolean hasGroupID = in.readBoolean();
    if (hasGroupID) {
        this.groupID = in.readUTF();
    }
}
 
Example 14
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    str = in.readUTF();
    arr = (long[])in.readObject();
}
 
Example 15
Source Project: Tomcat7.0.67   File: JspValueExpression.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.mark = in.readUTF();
    this.target = (ValueExpression) in.readObject();
}
 
Example 16
Source Project: tomcatsrc   File: JspValueExpression.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.mark = in.readUTF();
    this.target = (ValueExpression) in.readObject();
}
 
Example 17
@SuppressWarnings("unchecked")
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException{
    topicName = in.readUTF();
    rdd = (JavaRDD)in.readObject();
}
 
Example 18
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    bulkDeleteDirectory = in.readUTF();
    colMap = ArrayUtil.readIntArray(in);
}
 
Example 19
Source Project: ontopia   File: RDBMSLocator.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  address = in.readUTF();
}
 
Example 20
@Override
public void readExternal(final ObjectInput in) throws IOException,
		ClassNotFoundException {

	super.readExternal(in);

	final int version = LongPacker.unpackInt(in);
	
	keyLen = LongPacker.unpackInt(in);

	addressBits = LongPacker.unpackInt(in);

	htreeClassName = in.readUTF();

}