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

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

源代码1 项目: tomee   文件: EJBRequest.java
/**
 * Write to server.
 * WARNING: To maintain backwards compatibility never change the order or insert new writes, always append to
 * {@link org.apache.openejb.client.EJBRequest.Body#writeExternal(java.io.ObjectOutput)}
 *
 * @param out ObjectOutput
 * @throws IOException
 */
@Override
public void writeExternal(final ObjectOutput out) throws IOException {

    out.writeByte(requestMethod.getCode());

    if (deploymentCode > 0) {
        out.writeObject(null);
    } else {
        out.writeObject(deploymentId);
    }

    out.writeShort(deploymentCode);
    out.writeObject(clientIdentity);
    out.writeInt(serverHash);
    out.flush();

    body.setMetaData(metaData);
    body.writeExternal(out);
}
 
源代码2 项目: blip   文件: TCustomHashSet.java
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(1);

    // NOTE: Super was not written in version 0
    super.writeExternal(out);

    // NUMBER OF ENTRIES
    out.writeInt(_size);

    // ENTRIES
    for (int i = _set.length; i-- > 0;) {
        if (_set[i] != REMOVED && _set[i] != FREE) {
            out.writeObject(_set[i]);
        }
    }
}
 
源代码3 项目: incubator-hivemall   文件: RegressionTree.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(splitFeature);
    out.writeByte(quantitativeFeature ? NUMERIC : NOMINAL);
    out.writeDouble(splitValue);

    if (isLeaf()) {
        out.writeBoolean(true);
        out.writeDouble(output);
    } else {
        out.writeBoolean(false);
        if (trueChild == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            trueChild.writeExternal(out);
        }
        if (falseChild == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            falseChild.writeExternal(out);
        }
    }
}
 
源代码4 项目: netbeans   文件: SnapshotResultsWindow.java
public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);
    
    out.writeByte(PERSISTENCE_VERSION_MAJOR);
    out.writeByte(PERSISTENCE_VERSION_MINOR);
    
    out.writeUTF(Utilities.toURI(snapshot.getFile()).toString());
}
 
源代码5 项目: gemfirexd-oss   文件: GMS.java
public void writeExternal(ObjectOutput out) throws IOException {
            out.writeByte(type);
//            out.writeObject(view);
            out.writeObject(mbr);
//            out.writeObject(join_rsp);
//            out.writeObject(my_digest);
            out.writeObject(merge_id);
            out.writeBoolean(merge_rejected);
            out.writeBoolean(this.forcedOut); // GemStoneAddition
            out.writeObject(this.arg); // GemStoneAddition
        }
 
源代码6 项目: openjdk-8-source   文件: TCPEndpoint.java
/**
 * Write endpoint to output stream.
 */
public void write(ObjectOutput out) throws IOException {
    if (csf == null) {
        out.writeByte(FORMAT_HOST_PORT);
        out.writeUTF(host);
        out.writeInt(port);
    } else {
        out.writeByte(FORMAT_HOST_PORT_FACTORY);
        out.writeUTF(host);
        out.writeInt(port);
        out.writeObject(csf);
    }
}
 
源代码7 项目: dragonwell8_jdk   文件: MimeType.java
/**
 * The object implements the writeExternal method to save its contents
 * by calling the methods of DataOutput for its primitive values or
 * calling the writeObject method of ObjectOutput for objects, strings
 * and arrays.
 * @exception IOException Includes any I/O exceptions that may occur
 */
public void writeExternal(ObjectOutput out) throws IOException {
    String s = toString(); // contains ASCII chars only
    // one-to-one correspondence between ASCII char and byte in UTF string
    if (s.length() <= 65535) { // 65535 is max length of UTF string
        out.writeUTF(s);
    } else {
        out.writeByte(0);
        out.writeByte(0);
        out.writeInt(s.length());
        out.write(s.getBytes());
    }
}
 
@Override
public void writeObject(ObjectOutput output, RootAuthenticationSessionPredicate obj) throws IOException {
    output.writeByte(VERSION_1);

    MarshallUtil.marshallString(obj.realm, output);
    KeycloakMarshallUtil.marshall(obj.expired, output);

}
 
源代码9 项目: Time4A   文件: PersianCalendar.java
private void writePersian(ObjectOutput out) throws IOException {

            PersianCalendar persian = (PersianCalendar) this.obj;
            out.writeInt(persian.getYear());
            out.writeByte(persian.getMonth().getValue());
            out.writeByte(persian.getDayOfMonth());

        }
 
源代码10 项目: blip   文件: TIntDoubleHash.java
/**
 * {@inheritDoc}
 */
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // SUPER
    super.writeExternal(out);

    // NO_ENTRY_KEY
    out.writeInt(no_entry_key);

    // NO_ENTRY_VALUE
    out.writeDouble(no_entry_value);
}
 
源代码11 项目: reladomo   文件: BooleanAttribute.java
@Override
public void serializeNonNullAggregateDataValue(Nullable valueWrappedInNullable, ObjectOutput out) throws IOException
{
    MutableBoolean b = (MutableBoolean) valueWrappedInNullable;
    if (b.booleanValue())
    {
        out.writeByte(TRUE_BOOLEAN_VALUE);
    }
    else
    {
        out.writeByte(FALSE_BOOLEAN_VALUE);
    }
}
 
源代码12 项目: tomee   文件: DataSourceMetaData.java
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    // write out the version of the serialized data for future use
    out.writeByte(1);

    out.writeObject(jdbcDriver);
    out.writeObject(jdbcUrl);
    out.writeObject(defaultUserName);
    out.writeObject(defaultPassword);
}
 
源代码13 项目: gemfirexd-oss   文件: FD_SOCK.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeByte(type);
    out.writeObject(mbr);
    out.writeObject(sock_addr);
    out.writeObject(cachedAddrs);
    out.writeObject(mbrs);
    out.writeBoolean(this.abnormalTermination);
}
 
源代码14 项目: jdk8u-jdk   文件: Ser.java
static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException {
    out.writeByte(type);
    switch (type) {
        case DURATION_TYPE:
            ((Duration) object).writeExternal(out);
            break;
        case INSTANT_TYPE:
            ((Instant) object).writeExternal(out);
            break;
        case LOCAL_DATE_TYPE:
            ((LocalDate) object).writeExternal(out);
            break;
        case LOCAL_DATE_TIME_TYPE:
            ((LocalDateTime) object).writeExternal(out);
            break;
        case LOCAL_TIME_TYPE:
            ((LocalTime) object).writeExternal(out);
            break;
        case ZONE_REGION_TYPE:
            ((ZoneRegion) object).writeExternal(out);
            break;
        case ZONE_OFFSET_TYPE:
            ((ZoneOffset) object).writeExternal(out);
            break;
        case ZONE_DATE_TIME_TYPE:
            ((ZonedDateTime) object).writeExternal(out);
            break;
        case OFFSET_TIME_TYPE:
            ((OffsetTime) object).writeExternal(out);
            break;
        case OFFSET_DATE_TIME_TYPE:
            ((OffsetDateTime) object).writeExternal(out);
            break;
        case YEAR_TYPE:
            ((Year) object).writeExternal(out);
            break;
        case YEAR_MONTH_TYPE:
            ((YearMonth) object).writeExternal(out);
            break;
        case MONTH_DAY_TYPE:
            ((MonthDay) object).writeExternal(out);
            break;
        case PERIOD_TYPE:
            ((Period) object).writeExternal(out);
            break;
        default:
            throw new InvalidClassException("Unknown serialized type");
    }
}
 
源代码15 项目: ignite   文件: GridTopic.java
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeByte(topic.ordinal());
    U.writeUuid(out, id1);
}
 
源代码16 项目: j2objc   文件: Ser.java
static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException {
    out.writeByte(type);
    switch (type) {
        case DURATION_TYPE:
            ((Duration) object).writeExternal(out);
            break;
        case INSTANT_TYPE:
            ((Instant) object).writeExternal(out);
            break;
        case LOCAL_DATE_TYPE:
            ((LocalDate) object).writeExternal(out);
            break;
        case LOCAL_DATE_TIME_TYPE:
            ((LocalDateTime) object).writeExternal(out);
            break;
        case LOCAL_TIME_TYPE:
            ((LocalTime) object).writeExternal(out);
            break;
        case ZONE_REGION_TYPE:
            ((ZoneRegion) object).writeExternal(out);
            break;
        case ZONE_OFFSET_TYPE:
            ((ZoneOffset) object).writeExternal(out);
            break;
        case ZONE_DATE_TIME_TYPE:
            ((ZonedDateTime) object).writeExternal(out);
            break;
        case OFFSET_TIME_TYPE:
            ((OffsetTime) object).writeExternal(out);
            break;
        case OFFSET_DATE_TIME_TYPE:
            ((OffsetDateTime) object).writeExternal(out);
            break;
        case YEAR_TYPE:
            ((Year) object).writeExternal(out);
            break;
        case YEAR_MONTH_TYPE:
            ((YearMonth) object).writeExternal(out);
            break;
        case MONTH_DAY_TYPE:
            ((MonthDay) object).writeExternal(out);
            break;
        case PERIOD_TYPE:
            ((Period) object).writeExternal(out);
            break;
        default:
            throw new InvalidClassException("Unknown serialized type");
    }
}
 
源代码17 项目: spliceengine   文件: AbstractTxnView.java
@Override
public void writeExternal(ObjectOutput output) throws IOException {
   	output.writeLong(txnId);
   	output.writeLong(beginTimestamp);
   	output.writeByte(isolationLevel.encode());    			
}
 
源代码18 项目: database   文件: RemoteAsynchronousIteratorImpl.java
public void writeExternal(ObjectOutput out) throws IOException {

            out.writeByte(VERSION);
            
            out.writeObject(ser);
            
            ser.serialize(out, e);
            
        }
 
源代码19 项目: Time4A   文件: HebrewTime.java
private void writeHebrewTime(ObjectOutput out) throws IOException {

            HebrewTime time = (HebrewTime) this.obj;
            out.writeByte(time.getDigitalHour());
            out.writeShort(time.getPart());

        }
 
源代码20 项目: Time4A   文件: VietnameseCalendar.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {

    out.writeByte(VIETNAMESE);
    this.writeVietnamese(out);

}