當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectOutputStream.writeShort方法代碼示例

本文整理匯總了Java中java.io.ObjectOutputStream.writeShort方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectOutputStream.writeShort方法的具體用法?Java ObjectOutputStream.writeShort怎麽用?Java ObjectOutputStream.writeShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.ObjectOutputStream的用法示例。


在下文中一共展示了ObjectOutputStream.writeShort方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doReps

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
/**
 * Run benchmark for given number of batches, with given number of cycles
 * for each batch.
 */
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
            StreamBuffer sbuf, int nbatches, int ncycles)
    throws Exception
{
    for (int i = 0; i < nbatches; i++) {
        sbuf.reset();
        for (int j = 0; j < ncycles; j++) {
            oout.writeShort(0);
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readShort();
        }
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:20,代碼來源:Shorts.java

示例2: serialize

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
/**
 * See {@link GraphDBState#serialize(String)}.
 */
public void serialize(ObjectOutputStream objectOutputStream) throws IOException {
    objectOutputStream.writeInt(size);
    objectOutputStream.writeInt(neighbourIds.length);
    objectOutputStream.writeInt(edgeTypes.length);
    objectOutputStream.writeInt(edgeIds.length);
    for (int i = 0; i < size; i++) {
        objectOutputStream.writeInt(neighbourIds[i]);
        objectOutputStream.writeShort(edgeTypes[i]);
        objectOutputStream.writeLong(edgeIds[i]);
    }
}
 
開發者ID:graphflow,項目名稱:graphflow,代碼行數:15,代碼來源:SortedAdjacencyList.java

示例3: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream 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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:CustomObjTrees.java

示例4: write

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
    for (int index : indexes) {
        final long value = getLong(index);
        os.writeLong(value);
        if (value != defaultValueAsLong) {
            final short zoneId = zoneIds.get(index);
            os.writeShort(zoneId);
        }
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:12,代碼來源:SparseArrayOfZonedDateTimes.java

示例5: write

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
    for (int index : indexes) {
        final int byteIndex = index * BYTE_COUNT;
        final long epochMillis = byteBuffer.getLong(byteIndex);
        final short zoneId = byteBuffer.getShort(byteIndex + 8);
        os.writeLong(epochMillis);
        os.writeShort(zoneId);
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:11,代碼來源:MappedArrayOfZonedDateTimes.java

示例6: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
    os.writeInt(length);
    os.writeLong(defaultValueAsLong);
    os.writeShort(defaultZoneId);
    os.writeObject(defaultValue);
    for (int i=0; i<length; ++i) {
        final int byteIndex = i * BYTE_COUNT;
        final long epochMillis = byteBuffer.getLong(byteIndex);
        final short zoneId = byteBuffer.getShort(byteIndex + 8);
        os.writeLong(epochMillis);
        os.writeShort(zoneId);
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:15,代碼來源:MappedArrayOfZonedDateTimes.java

示例7: write

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
    for (int index : indexes) {
        final long value = values[index];
        os.writeLong(value);
        if (value != defaultValueAsLong) {
            os.writeShort(zoneIds[index]);
        }
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:11,代碼來源:DenseArrayOfZonedDateTimes.java

示例8: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
    final int length = values.length;
    os.writeInt(length);
    os.writeLong(defaultValueAsLong);
    os.writeObject(defaultValue);
    for (int i=0; i<length; ++i) {
        os.writeLong(values[i]);
        os.writeShort(zoneIds[i]);
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:12,代碼來源:DenseArrayOfZonedDateTimes.java

示例9: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream oos) throws IOException {
    oos.writeShort(1);
}
 
開發者ID:tomoncle,項目名稱:JavaStudy,代碼行數:4,代碼來源:MineC3P0DataSource.java

示例10: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream oos) throws IOException {
    oos.writeShort(2);
}
 
開發者ID:shizicheng,項目名稱:spring_mvc_template,代碼行數:4,代碼來源:DataSource.java


注:本文中的java.io.ObjectOutputStream.writeShort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。