當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。