当前位置: 首页>>代码示例>>Java>>正文


Java DataInput.readChar方法代码示例

本文整理汇总了Java中java.io.DataInput.readChar方法的典型用法代码示例。如果您正苦于以下问题:Java DataInput.readChar方法的具体用法?Java DataInput.readChar怎么用?Java DataInput.readChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.DataInput的用法示例。


在下文中一共展示了DataInput.readChar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readCharArray

import java.io.DataInput; //导入方法依赖的package包/类
/**
 * Reads an array of <code>char</code>s from a <code>DataInput</code>.
 *
 * @throws IOException A problem occurs while reading from <code>in</code>
 *
 * @see #writeCharArray
 * @since GemFire 5.7
 */
public static char[] readCharArray(DataInput in) throws IOException {

  InternalDataSerializer.checkIn(in);

  int length = InternalDataSerializer.readArrayLength(in);
  if (length == -1) {
    return null;
  } else {
    char[] array = new char[length];
    for (int i = 0; i < length; i++) {
      array[i] = in.readChar();
    }

    if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
      logger.trace(LogMarker.SERIALIZER, "Read char array of length {}", length);
    }

    return array;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:29,代码来源:DataSerializer.java

示例2: read

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void read(DataInput stream) throws Exception{
    char[] chars = new char[stream.readInt()];

    for(int i = 0; i < chars.length; i++){
        chars[i] = stream.readChar();
    }

    this.data = new String(chars);
}
 
开发者ID:RockBottomGame,项目名称:API,代码行数:11,代码来源:PartString.java

示例3: readPrimitiveChar

import java.io.DataInput; //导入方法依赖的package包/类
/**
 * Reads a primitive <code>char</code> from a <code>DataInput</code>.
 *
 * @throws IOException A problem occurs while reading from <code>in</code>
 * @see DataInput#readChar
 * @since GemFire 5.1
 */
public static char readPrimitiveChar(DataInput in) throws IOException {
  InternalDataSerializer.checkIn(in);

  char value = in.readChar();
  if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
    logger.trace(LogMarker.SERIALIZER, "Read Char {}", value);
  }
  return value;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:17,代码来源:DataSerializer.java

示例4: readCharArray

import java.io.DataInput; //导入方法依赖的package包/类
private void readCharArray(DataInput in) throws IOException {
  char[] v = (char[]) value;
  for (int i = 0; i < length; i++)
    v[i] = in.readChar(); 
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:6,代码来源:ArrayPrimitiveWritable.java

示例5: readStream

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public Character readStream(final DataInput data)
        throws IOException
{
    return data.readChar();
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:7,代码来源:DataTypeList.java

示例6: read

import java.io.DataInput; //导入方法依赖的package包/类
/** Read ArithmeticProgression from DataInput */
private static ArithmeticProgression read(DataInput in) throws IOException {
  return new ArithmeticProgression(in.readChar(),
      in.readLong(), in.readLong(), in.readLong());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:SummationWritable.java


注:本文中的java.io.DataInput.readChar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。