当前位置: 首页>>代码示例>>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;未经允许,请勿转载。