java.io.ObjectOutput#writeShort ( )源码实例Demo

下面列出了java.io.ObjectOutput#writeShort ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: database   文件: BaseVocabulary.java
public void writeExternal(final ObjectOutput out) throws IOException {

        if (val2iv == null)
            throw new IllegalStateException();
        if (iv2val == null)
            throw new IllegalStateException();

        out.writeShort(currentVersion);

        switch (currentVersion) {
//        case VERSION0:
//            writeVersion0(out);
//            break;
//        case VERSION1:
//            writeVersion1(out);
//            break;
        case VERSION2:
            writeVersion2(out);
            break;
        default:
            throw new AssertionError();
        }
    
    }
 
源代码2 项目: gemfirexd-oss   文件: MethodCall.java
public void writeExternal(ObjectOutput out) throws IOException {
    if(method_name != null) {
        out.writeBoolean(true);
        out.writeUTF(method_name);
    }
    else {
        out.writeBoolean(false);
        out.writeShort(method_id);
    }
    out.writeObject(args);
    out.writeShort(mode);

    switch(mode) {
    case OLD:
        break;
    case METHOD:
        out.writeObject(method.getParameterTypes());
        out.writeObject(method.getDeclaringClass());
        break;
    case TYPES:
        out.writeObject(types);
        break;
    case SIGNATURE:
        out.writeObject(signature);
        break;
    case ID:
        break;
    default:
        if(log.isErrorEnabled()) log.error(ExternalStrings.MethodCall_MODE__0__IS_INVALID, mode);
        break;
    }

    if(payload != null) {
        out.writeBoolean(true);
        out.writeObject(payload);
    }
    else {
        out.writeBoolean(false);
    }
}
 
源代码3 项目: RoaringBitmap   文件: MappeableRunContainer.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeShort(Character.reverseBytes((char) this.nbrruns));
  for (int k = 0; k < 2 * this.nbrruns; ++k) {
    out.writeShort(Character.reverseBytes(this.valueslength.get(k)));
  }
}
 
源代码4 项目: jdk8u_jdk   文件: UnicastRef.java
/**
 * Marshal value to an ObjectOutput sink using RMI's serialization
 * format for parameters or return values.
 */
protected static void marshalValue(Class<?> type, Object value,
                                   ObjectOutput out)
    throws IOException
{
    if (type.isPrimitive()) {
        if (type == int.class) {
            out.writeInt(((Integer) value).intValue());
        } else if (type == boolean.class) {
            out.writeBoolean(((Boolean) value).booleanValue());
        } else if (type == byte.class) {
            out.writeByte(((Byte) value).byteValue());
        } else if (type == char.class) {
            out.writeChar(((Character) value).charValue());
        } else if (type == short.class) {
            out.writeShort(((Short) value).shortValue());
        } else if (type == long.class) {
            out.writeLong(((Long) value).longValue());
        } else if (type == float.class) {
            out.writeFloat(((Float) value).floatValue());
        } else if (type == double.class) {
            out.writeDouble(((Double) value).doubleValue());
        } else {
            throw new Error("Unrecognized primitive type: " + type);
        }
    } else {
        out.writeObject(value);
    }
}
 
源代码5 项目: spliceengine   文件: ConstraintContext.java
@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    short len = (short) (messageArgs == null ? 0 : messageArgs.length);
    objectOutput.writeShort(len);
    for (int i = 0; i < len; i++) {
        objectOutput.writeUTF(messageArgs[i]);
    }
}
 
public void send(byte code, ObjectOutput out) throws IOException {
    JClientRequestInfo info = new JRMPClientRequestInfoImpl();
    for (int i = 0; i < cis.length; i++) {
        cis[i].send_request(info);
    }
    Collection c = info.get_all_request_service_context();
    out.writeShort(c.size());
    for (Iterator it = c.iterator(); it.hasNext(); ) {
        out.writeObject(it.next());
    }
}
 
源代码7 项目: gemfirexd-oss   文件: XML.java
/**
 * Write an XML value. 
 * @param out The stream to which we're writing.
 */
public void writeExternal(ObjectOutput out) throws IOException
{
    // never called when value is null
    if (SanityManager.DEBUG)
        SanityManager.ASSERT(!isNull());

    // Write out the XML store impl id.
    out.writeShort(UTF8_IMPL_ID);

    // Now write out the data.
    xmlStringValue.writeExternal(out);
}
 
源代码8 项目: kogito-runtimes   文件: TraitField.java
public void writeExternal( ObjectOutput out ) throws IOException {
    out.writeObject( value );
    out.writeBoolean( isExplicitlySet );
    out.writeBoolean( explicitSetEnabled );

    out.writeObject( rangeTypes );

    out.writeObject( defaultValuesByTraits );
    out.writeObject( defaultValueByClass );

    out.writeShort( position );
}
 
源代码9 项目: RoaringBitmap   文件: MappeableArrayContainer.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {
  out.write(this.cardinality & 0xFF);
  out.write((this.cardinality >>> 8) & 0xFF);
  if (BufferUtil.isBackedBySimpleArray(content)) {
    char[] a = content.array();
    for (int k = 0; k < this.cardinality; ++k) {
      out.writeShort(Character.reverseBytes(a[k]));
    }
  } else {
    for (int k = 0; k < this.cardinality; ++k) {
      out.writeShort(Character.reverseBytes(content.get(k)));
    }
  }
}
 
源代码10 项目: tomee   文件: EJBHomeProxyHandle.java
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    // write out the version of the serialized data for future use
    out.writeByte(2);

    final boolean hasExec = handler.executor != null && handler.executor != JNDIContext.globalExecutor();
    out.writeBoolean(hasExec);
    if (hasExec) {
        out.writeInt(handler.executor.getMaximumPoolSize());
        final BlockingQueue<Runnable> queue = handler.executor.getQueue();
        out.writeInt(queue.size() + queue.remainingCapacity());
    }

    handler.client.setMetaData(metaData);
    handler.client.writeExternal(out);

    final EJBMetaDataImpl ejb = handler.ejb;
    out.writeObject(ejb.homeClass);
    out.writeObject(ejb.remoteClass);
    out.writeObject(ejb.keyClass);
    out.writeByte(ejb.type);
    out.writeUTF(ejb.deploymentID);
    out.writeShort(ejb.deploymentCode);

    handler.server.setMetaData(metaData);
    handler.server.writeExternal(out);
    ///        out.writeObject( handler.primaryKey );
}
 
源代码11 项目: Time4A   文件: SPX.java
private void writeFrenchRev(ObjectOutput out)
    throws IOException {

    FrenchRepublicanCalendar cal = (FrenchRepublicanCalendar) this.obj;
    out.writeInt(cal.getYear());
    out.writeShort(cal.getDayOfYear());

}
 
public void send(byte code, ObjectOutput out) throws IOException {
    JClientRequestInfo info = new JRMPClientRequestInfoImpl();
    for (int i = 0; i < cis.length; i++) {
        cis[i].send_request(info);
    }
    Collection c = info.get_all_request_service_context();
    out.writeShort(c.size());
    for (Iterator it = c.iterator(); it.hasNext(); ) {
        out.writeObject(it.next());
    }
}
 
源代码13 项目: jdk8u-jdk   文件: ExternObjTrees.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(z);
    out.writeByte(b);
    out.writeChar(c);
    out.writeShort(s);
    out.writeInt(i);
    out.writeFloat(f);
    out.writeLong(j);
    out.writeDouble(d);
    out.writeObject(str);
    out.writeObject(parent);
    out.writeObject(left);
    out.writeObject(right);
}
 
源代码14 项目: gemfirexd-oss   文件: XML.java
/**
 * Write an XML value. 
 * @param out The stream to which we're writing.
 */
public void writeExternal(ObjectOutput out) throws IOException
{
    // never called when value is null
    if (SanityManager.DEBUG)
        SanityManager.ASSERT(!isNull());

    // Write out the XML store impl id.
    out.writeShort(UTF8_IMPL_ID);

    // Now write out the data.
    xmlStringValue.writeExternal(out);
}
 
源代码15 项目: kylin-on-parquet-v2   文件: IntegerDimEnc.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeShort(fixedLen);
}
 
源代码16 项目: reladomo   文件: ShortAttribute.java
@Override
protected void serializedNonNullValue(T o, ObjectOutput out) throws IOException
{
    out.writeShort(this.shortValueOf(o));
}
 
源代码17 项目: kylin   文件: BooleanDimEnc.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeShort(fixedLen);
}
 
源代码18 项目: reladomo   文件: ShortAttribute.java
@Override
public void serializeNonNullAggregateDataValue(Nullable valueWrappedInNullable, ObjectOutput out) throws IOException
{
    out.writeShort(((MutableNumber)valueWrappedInNullable).shortValue());
}
 
源代码19 项目: symja_android_library   文件: ASTRealVector.java
@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
	objectOutput.writeShort(fEvalFlags);
	objectOutput.writeObject(vector);
}
 
源代码20 项目: database   文件: Checkpoint.java
@Override
   public void writeExternal(final ObjectOutput out) throws IOException {

       out.writeInt(currentVersion);

       out.writeLong(addrMetadata);

       out.writeLong(addrRoot);
       
       out.writeLong(addrBloomFilter);

       out.writeInt(height);

	if (currentVersion <= VERSION1) {

		if (nnodes > Integer.MAX_VALUE)
			throw new RuntimeException();
		if (nleaves > Integer.MAX_VALUE)
			throw new RuntimeException();
		if (nentries > Integer.MAX_VALUE)
			throw new RuntimeException();
		
		out.writeInt((int)nnodes);

		out.writeInt((int)nleaves);

		out.writeInt((int)nentries);

	} else {

		out.writeLong(nnodes);

		out.writeLong(nleaves);

		out.writeLong(nentries);

		out.writeLong(recordVersion);

	}

       out.writeLong(counter);

       /*
        * 8 bytes follow. 
        */
       
       out.writeShort(indexType.getCode());
	out.writeShort(0/* unused */);
	out.writeInt(0/* unused */);

	/*
	 * 8 bytes follow.
	 */

	out.writeLong(0L/* unused */);

	/*
	 * Additional space added in VERSION2.
	 */
	for (int i = 0; i < 10; i++) {

		out.writeLong(0L/* unused */);

	}
	
}