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

The following examples show how to use java.io.ObjectInput#readShort() . 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: ExternObjTrees.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void readExternal(ObjectInput in)
    throws IOException, ClassNotFoundException
{
    z = in.readBoolean();
    b = in.readByte();
    c = in.readChar();
    s = in.readShort();
    i = in.readInt();
    f = in.readFloat();
    j = in.readLong();
    d = in.readDouble();
    str = (String) in.readObject();
    parent = in.readObject();
    left = in.readObject();
    right = in.readObject();
}
 
Example 2
Source File: SPX.java    From Time4A with Apache License 2.0 6 votes vote down vote up
private FrenchRepublicanCalendar readFrenchRev(ObjectInput in)
    throws IOException, ClassNotFoundException {

    int year = in.readInt();
    int doy = in.readShort();

    if (doy <= 360) {
        int m = ((doy - 1) / 30) + 1;
        int dom = ((doy - 1) % 30) + 1;
        return FrenchRepublicanCalendar.of(year, m, dom);
    } else {
        Sansculottides s = Sansculottides.valueOf(doy - 360);
        return FrenchRepublicanCalendar.of(year, s);
    }

}
 
Example 3
Source File: AST0.java    From symja_android_library with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
	this.fEvalFlags = objectInput.readShort();

	int size;
	byte attributeFlags = objectInput.readByte();
	if (attributeFlags != 0) {
		size = attributeFlags;
		int exprIDSize = objectInput.readByte();
		for (int i = 0; i < exprIDSize; i++) {
			set(i, F.exprID(objectInput.readShort()));// F.GLOBAL_IDS[objectInput.readShort()]);
		}
		for (int i = exprIDSize; i < size; i++) {
			set(i, (IExpr) objectInput.readObject());
		}
		return;
	}

	size = objectInput.readInt();
	for (int i = 0; i < size; i++) {
		set(i, (IExpr) objectInput.readObject());
	}
}
 
Example 4
Source File: ExternObjTrees.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void readExternal(ObjectInput in)
    throws IOException, ClassNotFoundException
{
    z = in.readBoolean();
    b = in.readByte();
    c = in.readChar();
    s = in.readShort();
    i = in.readInt();
    f = in.readFloat();
    j = in.readLong();
    d = in.readDouble();
    str = (String) in.readObject();
    parent = in.readObject();
    left = in.readObject();
    right = in.readObject();
}
 
Example 5
Source File: IgniteComputeConfigVariationsFullApiTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    arg = in.readObject();

    isVal = in.readBoolean();
    bVal = in.readByte();
    cVal = in.readChar();
    sVal = in.readShort();
    intVal = in.readInt();
    lVal = in.readLong();
    fltVal = in.readFloat();
    dblVal = in.readDouble();
    strVal = (String)in.readObject();
    arrVal = (Object[])in.readObject();
    eVal = (TestJobEnum)in.readObject();
}
 
Example 6
Source File: PatternMatcherAndEvaluator.java    From symja_android_library with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
	short ordinal = objectInput.readShort();
	fSetFlags = ordinal & 0x7FFF;
	fLhsPatternExpr = (IExpr) objectInput.readObject();
	fRightHandSide = (IExpr) objectInput.readObject();
	if ((ordinal & 0x8000) == 0x0000) {
		fPatternCondition = (IExpr) objectInput.readObject();
	}

	if (fLhsPatternExpr != null) {
		int[] priority = new int[] { IPatternMap.DEFAULT_RULE_PRIORITY };
		this.fPatternMap = IPatternMap.determinePatterns(fLhsPatternExpr, priority);
	}
	initRHSleafCountSimplify();
}
 
Example 7
Source File: B1.java    From symja_android_library with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
	this.fEvalFlags = objectInput.readShort();

	// int size;
	// byte attributeFlags = objectInput.readByte();
	// if (attributeFlags != 0) {
	// size = attributeFlags;
	// int exprIDSize = objectInput.readByte();
	// for (int i = 0; i < exprIDSize; i++) {
	// set(i, F.GLOBAL_IDS[objectInput.readShort()]);
	// }
	// for (int i = exprIDSize; i < size; i++) {
	// set(i, (IExpr) objectInput.readObject());
	// }
	// return;
	// }

	// size = objectInput.readInt();
	for (int i = 1; i < SIZE; i++) {
		set(i, (IExpr) objectInput.readObject());
	}
}
 
Example 8
Source File: IntegerSym.java    From symja_android_library with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
	byte attributeFlags = objectInput.readByte();
	int value;
	switch (attributeFlags) {
	case 1:
		value = objectInput.readByte();
		fIntValue = value;
		return;
	case 2:
		value = objectInput.readShort();
		fIntValue = value;
		return;
	case 4:
		value = objectInput.readInt();
		fIntValue = value;
		return;
	default:
	}
}
 
Example 9
Source File: right_IrmiPRODelegate_1.3.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
public void receive(byte code, ObjectInput in)
    throws IOException, ClassNotFoundException {
    JServerRequestInfo info = new JRMPServerRequestInfoImpl();
    int len = in.readShort();
    for (int i = 0; i < len; i++) {
        info.add_reply_service_context((JServiceContext) in.readObject());
    }
    for (int i = 0; i < sis.length; i++) {
        sis[i].receive_request(info);
    }
}
 
Example 10
Source File: SingleHopInformation.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public void readExternal(ObjectInput in) throws IOException,
    ClassNotFoundException {
  this.bucketId = ClientSharedUtils.getJdkHelper().newInteger(in.readInt());
  this.primaryBucketServersStr = in.readUTF();
  int secServerArrayLen = in.readShort();
  // 0 indicates no secondary server length sent from server
  if (secServerArrayLen != -1) {
    this.secondaryBucketServersStr = new String[secServerArrayLen];
    for (int i = 0; i < secServerArrayLen; i++) {
      this.secondaryBucketServersStr[i] = in.readUTF();
    }
  }
}
 
Example 11
Source File: RoutineAliasInfo.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Read this object from a stream of stored objects.
 *
 * @param in read this.
 *
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal( ObjectInput in )
	 throws IOException, ClassNotFoundException
{
	super.readExternal(in);
	specificName = (String) in.readObject();
	dynamicResultSets = in.readInt();
	parameterCount = in.readInt();
	parameterStyle = in.readShort();
	sqlAllowed = in.readShort();
	returnType = getStoredType(in.readObject());
	calledOnNullInput = in.readBoolean();
	in.readInt(); // future expansion.

	if (parameterCount != 0) {
		parameterNames = new String[parameterCount];
		parameterTypes = new TypeDescriptor[parameterCount];

		ArrayUtil.readArrayItems(in, parameterNames);
           for (int p = 0; p < parameterTypes.length; p++)
           {
               parameterTypes[p] = getStoredType(in.readObject());
           }
		parameterModes = ArrayUtil.readIntArray(in);

	} else {
		parameterNames = null;
		parameterTypes = null;
		parameterModes = null;
	}
}
 
Example 12
Source File: MethodCall.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    boolean name_available=in.readBoolean();
    if(name_available)
        method_name=in.readUTF();
    else
        method_id=in.readShort();
    args=(Object[])in.readObject();
    mode=in.readShort();

    switch(mode) {
    case OLD:
        break;
    case METHOD:
        Class[] parametertypes=(Class[])in.readObject();
        Class   declaringclass=(Class)in.readObject();
        try {
            method=declaringclass.getDeclaredMethod(method_name, parametertypes);
        }
        catch(NoSuchMethodException e) {
            throw new IOException(e.toString());
        }
        break;
    case TYPES:
        types=(Class[])in.readObject();
        break;
    case SIGNATURE:
        signature=(String[])in.readObject();
        break;
    case ID:
        break;
    default:
        if(log.isErrorEnabled()) log.error(ExternalStrings.MethodCall_MODE__0__IS_INVALID, mode);
        break;
    }

    boolean payload_available=in.readBoolean();
    if(payload_available) {
        payload=(Map)in.readObject();
    }
}
 
Example 13
Source File: XML.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
     * Read an XML value from an input stream.
     * @param in The stream from which we're reading.
     */
    public void readExternal(ObjectInput in) throws IOException
    {
        if (xmlStringValue == null)
// GemStone changes BEGIN
        {
            // use SQLVarchar by default to get correct lengths
            xmlStringValue = new SQLVarchar();
        }
            /* (original code)
            xmlStringValue = new SQLChar();
            */
// GemStone changes END

        // Read the XML implementation id.  Right now there's
        // only one implementation (UTF-8 based), so we don't
        // use this value.  But if better implementations come
        // up in the future, we'll have to use this impl id to
        // figure out how to read the data.
        in.readShort();

        // Now just read the XML data as UTF-8.
        xmlStringValue.readExternal(in);

        // If we read it from disk then it must have type
        // XML_DOC_ANY because that's all we allow to be
        // written into an XML column.
        setXType(XML_DOC_ANY);
    }
 
Example 14
Source File: EJBObjectHandle.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    ThreadPoolExecutor executorService;
    if (version > 1) {
        if (in.readBoolean()) {
            final int queue = in.readInt();
            final BlockingQueue<Runnable> blockingQueue = new LinkedBlockingQueue<Runnable>((queue < 2 ? 2 : queue));
            final int threads = in.readInt();
            executorService = JNDIContext.newExecutor(threads, blockingQueue);
        } else {
            executorService = null;
        }
    } else {
        executorService = JNDIContext.globalExecutor();
    }

    final ClientMetaData client = new ClientMetaData();
    final EJBMetaDataImpl ejb = new EJBMetaDataImpl();
    final ServerMetaData server = new ServerMetaData();

    client.setMetaData(metaData);
    client.readExternal(in);

    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if (classLoader == null) {
        classLoader = this.getClass().getClassLoader();
    }

    ejb.homeClass = loadClass(classLoader, (String) in.readObject());
    ejb.remoteClass = loadClass(classLoader, (String) in.readObject());
    ejb.keyClass = loadClass(classLoader, (String) in.readObject());
    ejb.type = in.readByte();
    ejb.deploymentID = in.readUTF();
    ejb.deploymentCode = in.readShort();

    server.setMetaData(metaData);
    server.readExternal(in);

    final Object primaryKey = in.readObject();

    handler = EJBObjectHandler.createEJBObjectHandler(executorService, ejb, server, client, primaryKey, null);
    ejbObjectProxy = handler.createEJBObjectProxy();
}
 
Example 15
Source File: ShortUpdateWrapper.java    From reladomo with Apache License 2.0 4 votes vote down vote up
@Override
public void readParameter(ObjectInput in) throws IOException, ClassNotFoundException
{
    this.newValue = in.readShort();
}
 
Example 16
Source File: OneMoreByteVLongDimEnc.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fixedLen = in.readShort();
}
 
Example 17
Source File: TrimmedDimEnc.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fixedLen = in.readShort();
}
 
Example 18
Source File: BooleanDimEnc.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fixedLen = in.readShort();
}
 
Example 19
Source File: HAWriteMessageBase.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 {

    final short version = in.readShort();

    if (version != VERSION0)
        throw new RuntimeException("Bad version for serialization");

    sze = in.readInt();
    
    chk = in.readInt();
    
}
 
Example 20
Source File: TPS.java    From database with GNU General Public License v2.0 2 votes vote down vote up
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {

        final short version = in.readShort();
        
        if (version != VERSION0)
            throw new IOException("Unknown version=" + version);

        this.schema = (Schema)in.readObject();

        this.writeTime = in.readLong();
        
        this.tuples = new TreeMap<TP,ITPV>();

        this.preconditionOk = in.readBoolean();
        
        // #of tuples.
        final int n = in.readInt();

        if (log.isDebugEnabled())
            log.info("n=" + n + ", schema=" + schema);

        for (int i = 0; i < n; i++) {

            final String name = in.readUTF();
            
            final long timestamp = in.readLong();
            
            final int nbytes = in.readInt() - 1;
            
            final byte[] val = (nbytes == -1 ? null : new byte[nbytes]);
            
            if (val != null) {

                in.readFully(val);
                
            }
            
            final Object value = ValueType.decode(val);
            
            final TPV tpv = new TPV(schema,name,timestamp,value);
            
            tuples.put(new TP(name, timestamp), tpv);
            
            if (log.isDebugEnabled())
                log.info("tuple: name=" + name + ", timestamp=" + timestamp
                        + ", value=" + value);

        }
        
    }