本文整理汇总了Java中java.io.ObjectOutputStream.reset方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOutputStream.reset方法的具体用法?Java ObjectOutputStream.reset怎么用?Java ObjectOutputStream.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectOutputStream
的用法示例。
在下文中一共展示了ObjectOutputStream.reset方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, Node[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例3: 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[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例4: 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, String[] strs, int nbatches, int ncycles)
throws Exception
{
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(strs[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例5: 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, boolean[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例6: doReps
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of batches, with each batch containing
* the given number of cycles.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, Node[] trees, int nbatches)
throws Exception
{
int ncycles = trees.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(trees[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例7: 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, byte[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例8: 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, char[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例9: 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, long[][] arrays, int nbatches)
throws Exception
{
int ncycles = arrays.length;
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeObject(arrays[j]);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readObject();
}
}
}
示例10: doReps
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of cycles.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, ObjectStreamClass[] descs, int ncycles)
throws Exception
{
int ndescs = descs.length;
for (int i = 0; i < ncycles; i++) {
sbuf.reset();
oout.reset();
for (int j = 0; j < ndescs; j++) {
oout.writeObject(descs[j]);
}
oout.flush();
for (int j = 0; j < ndescs; j++) {
oin.readObject();
}
}
}
示例11: doReps
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of cycles.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, ObjectStreamClass desc, int ncycles)
throws Exception
{
for (int i = 0; i < ncycles; i++) {
sbuf.reset();
oout.reset();
oout.writeObject(desc);
oout.flush();
oin.readObject();
}
}