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

The following examples show how to use java.io.ObjectInput#readUTF() . 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
Source File: HijriCalendar.java    From Time4A with 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 2
Source File: MVELCompilationUnit.java    From kogito-runtimes with Apache License 2.0 6 votes vote down vote up
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 File: BaseClassFieldReader.java    From kogito-runtimes with Apache License 2.0 6 votes vote down vote up
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 4
Source File: DataLocation.java    From org.openntf.domino with 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 5
Source File: MixMessage.java    From incubator-hivemall with 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 6
Source File: JGroupsVersioningJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
@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 7
Source File: MethodExpressionImpl.java    From tomcatsrc with 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 8
Source File: MimeType.java    From openjdk-8 with 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 9
Source File: ReconfigureReply.java    From library with 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 10
Source File: EJBMetaDataImpl.java    From tomee with 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 11
Source File: DocumentDefinition.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@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 12
Source File: MimeType.java    From Bytecoder with 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 13
Source File: ActiveMQConnectionFactory.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
@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 14
Source File: JspValueExpression.java    From tomcatsrc with 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 15
Source File: JspValueExpression.java    From Tomcat7.0.67 with 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 File: SparkKafkaDataSetWriter.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException{
    topicName = in.readUTF();
    rdd = (JavaRDD)in.readObject();
}
 
Example 17
Source File: BulkDeleteRowIndexGenerationFunction.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    bulkDeleteDirectory = in.readUTF();
    colMap = ArrayUtil.readIntArray(in);
}
 
Example 18
Source File: GridBinaryMarshallerCtxDisabledSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    str = in.readUTF();
    arr = (long[])in.readObject();
}
 
Example 19
Source File: RDBMSLocator.java    From ontopia with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  address = in.readUTF();
}
 
Example 20
Source File: HTreeIndexMetadata.java    From database with GNU General Public License v2.0 3 votes vote down vote up
@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();

}