本文整理汇总了Java中java.io.DataOutput.writeChar方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutput.writeChar方法的具体用法?Java DataOutput.writeChar怎么用?Java DataOutput.writeChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.DataOutput
的用法示例。
在下文中一共展示了DataOutput.writeChar方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeCharArray
import java.io.DataOutput; //导入方法依赖的package包/类
/**
* Writes given number of characters from array of <code>char</code>s to a
* <code>DataOutput</code>.
*
* @throws IOException A problem occurs while writing to <code>out</code>
*
* @see DataSerializer#readCharArray
* @since GemFire 6.6
*/
public static void writeCharArray(char[] array, int length, DataOutput out) throws IOException {
checkOut(out);
if (array == null) {
length = -1;
}
writeArrayLength(length, out);
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Writing char array of length {}", length);
}
if (length > 0) {
for (int i = 0; i < length; i++) {
out.writeChar(array[i]);
}
}
}
示例2: write
import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
out.writeBoolean(false);
out.writeChar('O');
super.write(out);
out.writeInt(neuron.id);
out.writeInt(parents.size());
for(Map.Entry<Integer, TreeSet<Provider<Node>>> me: parents.entrySet()) {
out.writeInt(me.getKey());
out.writeInt(me.getValue().size());
for(Provider<Node> pn: me.getValue()) {
out.writeInt(pn.id);
}
}
}
示例3: write
import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput stream) throws Exception{
stream.writeInt(this.data.length());
for(char c : this.data.toCharArray()){
stream.writeChar(c);
}
}
示例4: writeCharacter
import java.io.DataOutput; //导入方法依赖的package包/类
/**
* Writes an instance of <code>Character</code> to a <code>DataOutput</code>.
*
* @throws IOException A problem occurs while writing to <code>out</code>
* @throws NullPointerException if value is null.
*
* @see #readCharacter
*/
public static void writeCharacter(Character value, DataOutput out) throws IOException {
InternalDataSerializer.checkOut(out);
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Writing Character {}", value);
}
out.writeChar(value.charValue());
}
示例5: writePrimitiveChar
import java.io.DataOutput; //导入方法依赖的package包/类
/**
* Writes a primitive <code>char</code> to a <code>DataOutput</code>.
*
* @throws IOException A problem occurs while writing to <code>out</code>
*
* @see DataOutput#writeChar
* @since GemFire 5.1
*/
public static void writePrimitiveChar(char value, DataOutput out) throws IOException {
InternalDataSerializer.checkOut(out);
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Writing Char {}", value);
}
out.writeChar(value);
}
示例6: write
import java.io.DataOutput; //导入方法依赖的package包/类
/** Write ArithmeticProgression to DataOutput */
private static void write(ArithmeticProgression ap, DataOutput out
) throws IOException {
out.writeChar(ap.symbol);
out.writeLong(ap.value);
out.writeLong(ap.delta);
out.writeLong(ap.limit);
}
示例7: write
import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
out.writeBoolean(false);
out.writeChar('A');
super.write(out);
out.writeInt(parents.size());
for(Map.Entry<Refinement, Provider<? extends Node>> me: parents.entrySet()) {
me.getKey().write(out);
out.writeInt(me.getValue().id);
}
}
示例8: write
import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
out.writeBoolean(false);
out.writeChar('I');
super.write(out);
key.write(out);
out.writeBoolean(inputNeuron != null);
if (inputNeuron != null) {
out.writeInt(inputNeuron.id);
}
}
示例9: writeCharArray
import java.io.DataOutput; //导入方法依赖的package包/类
private void writeCharArray(DataOutput out) throws IOException {
char[] v = (char[]) value;
for (int i = 0; i < length; i++)
out.writeChar(v[i]);
}
示例10: writeStream
import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void writeStream(final DataOutput data,
final Character value) throws IOException
{
data.writeChar(value);
}