writeChar ( )源码实例Demo

java.io.ObjectOutputStream#writeChar ( )源码实例Demo

下面列出了java.io.ObjectOutputStream#writeChar ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码2 项目: openjdk-8   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码3 项目: openjdk-jdk8u   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码4 项目: jdk8u-dev-jdk   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码6 项目: openjdk-jdk9   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码7 项目: openjdk-8-source   文件: Chars.java
/**
 * 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.writeChar('0');
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readChar();
        }
    }
}
 
源代码8 项目: dragonwell8_jdk   文件: CustomObjTrees.java
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);
}
 
源代码9 项目: openjdk-8-source   文件: CustomObjTrees.java
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);
}
 
源代码10 项目: TencentKona-8   文件: CustomObjTrees.java
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);
}
 
源代码11 项目: openjdk-8   文件: CustomObjTrees.java
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);
}
 
源代码12 项目: jdk8u60   文件: CustomObjTrees.java
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);
}
 
源代码13 项目: SEANLP   文件: FeatureFunction.java
public void save(ObjectOutputStream oos) throws Exception {
	oos.writeInt(o.length);
	for (char c : o) {
		oos.writeChar(c);
	}
	oos.writeInt(w.length);
	for (double v : w) {
		oos.writeDouble(v);
	}
}
 
源代码14 项目: jdk8u-dev-jdk   文件: CustomObjTrees.java
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);
}
 
源代码15 项目: openjdk-jdk9   文件: CustomObjTrees.java
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);
}
 
源代码16 项目: jdk8u-jdk   文件: CustomObjTrees.java
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);
}
 
源代码17 项目: jdk8u-jdk   文件: CustomObjTrees.java
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);
}
 
/**
 * Writes a serializable object description to the given object output stream.
 *
 * @param o      the to be serialized object.
 * @param stream the outputstream that should receive the object.
 * @throws IOException if an I/O error occured.
 */
public void writeObject( final Object o, final ObjectOutputStream stream ) throws IOException {
  final AttributedString as = (AttributedString) o;
  final AttributedCharacterIterator aci = as.getIterator();
  // build a plain string from aci
  // then write the string
  StringBuffer plainStr = new StringBuffer( 100 );
  char current = aci.first();
  while ( current != CharacterIterator.DONE ) {
    plainStr = plainStr.append( current );
    current = aci.next();
  }
  stream.writeObject( plainStr.toString() );

  // then write the attributes and limits for each run
  current = aci.first();
  final int begin = aci.getBeginIndex();
  while ( current != CharacterIterator.DONE ) {
    // write the current character - when the reader sees that this
    // is not CharacterIterator.DONE, it will know to read the
    // run limits and attributes
    stream.writeChar( current );

    // now write the limit, adjusted as if beginIndex is zero
    final int limit = aci.getRunLimit();
    stream.writeInt( limit - begin );

    // now write the attribute set
    final Map<AttributedCharacterIterator.Attribute, Object> atts =
      new HashMap<AttributedCharacterIterator.Attribute, Object>( aci.getAttributes() );
    stream.writeObject( atts );
    current = aci.setIndex( limit );
  }
  // write a character that signals to the reader that all runs
  // are done...
  stream.writeChar( CharacterIterator.DONE );

}
 
源代码19 项目: hottub   文件: CustomObjTrees.java
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);
}
 
源代码20 项目: visualvm   文件: MethodInvokedFirstTimeCommand.java
void writeObject(ObjectOutputStream out) throws IOException {
    out.writeChar(methodId);
}