本文整理汇总了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();
}
示例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();
}
}
}
示例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());
}
示例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);
}
示例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());
}
示例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));
}
}
示例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;
}
示例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);
}
示例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]);
}
}
}
示例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);
}
示例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());
}
示例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());
}
示例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]);
}
}
示例14: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
s.writeLong(sum());
}
示例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);
}