下面列出了java.io.ObjectOutputStream#reset ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, short[][] 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();
}
}
}
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, double[][] 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();
}
}
}
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, short[][] 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();
}
}
}
/**
* 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();
}
}
}
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, Proxy[][] 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
}
/**
* 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();
}
}
/**
* 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();
}
}