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


Java ObjectOutputStream.writeLong方法代碼示例

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


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

示例1: close

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
void close() throws IOException {
    steCache = null;
    GZIPOutputStream stream = new GZIPOutputStream(outStream, 64 * 1024);
    ObjectOutputStream out = new ObjectOutputStream(stream);
    int size = samples.size();
    out.writeInt(size);
    out.writeLong(getSample(size-1).getTime());
    openProgress();
    for (int i=0; i<size;i++) {
        Sample s = getSample(i);
        removeSample(i);
        if (i > 0 && i % RESET_THRESHOLD == 0) {
            out.reset();
        }
        s.writeToStream(out);
        if ((i+40) % 50 == 0) step((STEPS*i)/size);
    }
    step(STEPS); // set progress at 100%
    out.close();
    closeProgress();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:SamplesOutputStream.java

示例2: 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.writeLong(0);
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readLong();
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:Longs.java

示例3: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeObject(cookie.name());
    out.writeObject(cookie.value());
    out.writeLong(cookie.expiresAt());
    out.writeObject(cookie.domain());
    out.writeObject(cookie.path());
    out.writeBoolean(cookie.secure());
    out.writeBoolean(cookie.httpOnly());
    out.writeBoolean(cookie.hostOnly());
    out.writeBoolean(cookie.persistent());
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:13,代碼來源:SerializableCookie.java

示例4: 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

示例5: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream out) throws IOException {
    out.writeObject(cookie.name());
    out.writeObject(cookie.value());
    out.writeLong(cookie.persistent() ? cookie.expiresAt() : NON_VALID_EXPIRES_AT);
    out.writeObject(cookie.domain());
    out.writeObject(cookie.path());
    out.writeBoolean(cookie.secure());
    out.writeBoolean(cookie.httpOnly());
    out.writeBoolean(cookie.hostOnly());
}
 
開發者ID:qiaop,項目名稱:basicapp,代碼行數:11,代碼來源:SerializableCookie.java

示例6: writeToStream

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeToStream(ObjectOutputStream out) throws IOException {
    out.writeLong(time);
    out.writeInt(sameThread.size());
    for (Long tid : sameThread) {
        out.writeLong(tid.longValue());
    }
    out.writeInt(newThreads.size());
    for (ThreadInfo tic : newThreads) {
        out.writeObject(toCompositeData(tic));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:SamplesOutputStream.java

示例7: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
void writeObject(ObjectOutputStream out) throws IOException {
    out.writeLong(time.getTime());
    out.writeInt(newNames.length);
    for (int i = 0; i < newNames.length; i++) {
        out.writeUTF(newNames[i]);
    }
    out.writeInt(newids.length);
    for (int i = 0; i < newids.length; i++) {
        out.writeInt(newids[i]);
    }
    out.writeInt(ids.length);
    for (int i = 0; i < ids.length; i++) {
        out.writeInt(ids[i]);
    }
    out.writeInt(instances.length);
    for (int i = 0; i < instances.length; i++) {
        out.writeLong(instances[i]);
    }
    out.writeInt(bytes.length);
    for (int i = 0; i < bytes.length; i++) {
        out.writeLong(bytes[i]);
    }
    newNames = null;
    newids = null;
    ids = null;
    instances = null;
    bytes = null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:HeapHistogramResponse.java

示例8: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
void writeObject(ObjectOutputStream out) throws IOException {
    out.writeInt(agentVersion);
    out.writeUTF(jdkVersionString);
    out.writeUTF(javaClassPath);
    out.writeUTF(javaExtDirs);
    out.writeUTF(bootClassPath);
    out.writeUTF(workingDir);
    out.writeUTF(jvmArguments);
    out.writeUTF(javaCommand);
    out.writeUTF(targetMachineOSName);
    out.writeLong(maxHeapSize);
    out.writeLong(startupTimeMillis);
    out.writeLong(startupTimeInCounts);
    out.writeInt(agentId);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:VMPropertiesResponse.java

示例9: 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

示例10: serializeMainFile

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
@Override
public void serializeMainFile(ObjectOutputStream objectOutputStream) throws IOException {
    objectOutputStream.writeInt(data.length);
    objectOutputStream.writeLong(nextIDNeverYetAssigned);
    objectOutputStream.writeByte(nextBucketOffset);
    objectOutputStream.writeInt(nextBucketId);
    objectOutputStream.writeInt(nextPartitionId);
    objectOutputStream.writeInt(recycledIdsSize);
    objectOutputStream.writeObject(recycledIds);
}
 
開發者ID:graphflow,項目名稱:graphflow,代碼行數:11,代碼來源:EdgeStore.java

示例11: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream out) throws IOException {
    out.writeObject(cookie.name());
    out.writeObject(cookie.value());
    out.writeLong(cookie.expiresAt());
    out.writeObject(cookie.domain());
    out.writeObject(cookie.path());
    out.writeBoolean(cookie.secure());
    out.writeBoolean(cookie.httpOnly());
    out.writeBoolean(cookie.hostOnly());
    out.writeBoolean(cookie.persistent());
}
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:12,代碼來源:SerializableHttpCookie.java

示例12: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream out) throws IOException {
    out.writeObject(cookies.name());
    out.writeObject(cookies.value());
    out.writeLong(cookies.expiresAt());
    out.writeObject(cookies.domain());
    out.writeObject(cookies.path());
    out.writeBoolean(cookies.secure());
    out.writeBoolean(cookies.httpOnly());
    out.writeBoolean(cookies.hostOnly());
    out.writeBoolean(cookies.persistent());
}
 
開發者ID:xiaoyaoyou1212,項目名稱:XSnow,代碼行數:12,代碼來源:OkHttpCookies.java

示例13: 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

示例14: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    s.writeLong(sum());
}
 
開發者ID:tramchamploo,項目名稱:buffer-slayer,代碼行數:5,代碼來源:LongAdderV8.java

示例15: writeObject

import java.io.ObjectOutputStream; //導入方法依賴的package包/類
void writeObject(ObjectOutputStream out) throws IOException {
    out.writeInt(mode);
    for (int i = 0; i < generalNumbers.length; i++) {
        out.writeLong(generalNumbers[i]);
    }

    if (mode == CommonConstants.MODE_THREADS_SAMPLING) {
        out.writeInt(nThreads);
        out.writeInt(nThreadStates);
        for (int i = 0; i < nThreads; i++) {
            out.writeInt(threadIds[i]);
        }
        for (int i = 0; i < nThreadStates; i++) {
            out.writeLong(stateTimestamps[i]);
        }
        int len = nThreads * nThreadStates;
        out.write(threadStates, 0, len);
    } else if (mode == CommonConstants.MODE_THREADS_EXACT) {
        out.writeInt(exactThreadStates.length);
        for (int i = 0; i < exactThreadIds.length; i++) {
            out.writeInt(exactThreadIds[i]);
            out.writeByte(exactThreadStates[i]);
            out.writeLong(exactTimeStamps[i]);
        }
    }

    if (nNewThreads == 0) {
        out.writeInt(0);
    } else {
        out.writeInt(nNewThreads);

        for (int i = 0; i < nNewThreads; i++) {
            out.writeInt(newThreadIds[i]);
            out.writeUTF(newThreadNames[i]);
            out.writeUTF(newThreadClassNames[i]);
        }
    }

    out.writeInt(gcStarts.length);

    for (int i = 0; i < gcStarts.length; i++) {
        out.writeLong(gcStarts[i]);
    }

    out.writeInt(gcFinishs.length);

    for (int i = 0; i < gcFinishs.length; i++) {
        out.writeLong(gcFinishs[i]);
    }

    out.writeInt(serverState);
    out.writeInt(serverProgress);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:54,代碼來源:MonitoredNumbersResponse.java


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