java.io.DataInputStream.readChar()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中java.io.DataInputStream.readChar()方法的一些代码示例,展示了DataInputStream.readChar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataInputStream.readChar()方法的具体详情如下:
包路径:java.io.DataInputStream
类名称:DataInputStream
方法名:readChar

DataInputStream.readChar介绍

[英]See the general contract of the readChar method of DataInput.

Bytes for this operation are read from the contained input stream.
[中]参见readChar方法DataInput的总合同。
此操作的字节从包含的输入流中读取。

代码示例

代码示例来源:origin: netty/netty

@Override
public final char readChar() throws IOException {
  return in.readChar();
}

代码示例来源:origin: libgdx/libgdx

public final char readChar () throws IOException {
  return dis.readChar();
}

代码示例来源:origin: libgdx/libgdx

public char readChar () throws IOException {
  return din.readChar();
}

代码示例来源:origin: libgdx/libgdx

public char readChar () throws IOException {
  return din.readChar();
}

代码示例来源:origin: libgdx/libgdx

public final char readChar () throws IOException {
  return dis.readChar();
}

代码示例来源:origin: redisson/redisson

@Override
public final char readChar() throws IOException {
  return in.readChar();
}

代码示例来源:origin: wildfly/wildfly

@Override
public final char readChar() throws IOException {
  return in.readChar();
}

代码示例来源:origin: apache/geode

@Override
public char readChar() throws IOException {
 char result = this.dis.readChar();
 this.count += 2;
 return result;
}

代码示例来源:origin: robovm/robovm

/**
 * Reads a character (16 bit) from the source stream.
 *
 * @return the char value read from the source stream.
 * @throws EOFException
 *             if the end of the input is reached before the read
 *             request can be satisfied.
 * @throws IOException
 *             if an error occurs while reading from the source stream.
 */
public char readChar() throws IOException {
  return primitiveTypes.readChar();
}

代码示例来源:origin: io.netty/netty

public final char readChar() throws IOException {
  return in.readChar();
}

代码示例来源:origin: com.h2database/h2

/**
 * Read a string.
 *
 * @return the value
 */
public String readString() throws IOException {
  int len = in.readInt();
  if (len == -1) {
    return null;
  }
  StringBuilder buff = new StringBuilder(len);
  for (int i = 0; i < len; i++) {
    buff.append(in.readChar());
  }
  String s = buff.toString();
  s = StringUtils.cache(s);
  return s;
}

代码示例来源:origin: lealone/Lealone

/**
 * Read a string.
 *
 * @return the value
 */
@Override
public String readString() throws IOException {
  int len = in.readInt();
  if (len == -1) {
    return null;
  }
  StringBuilder buff = new StringBuilder(len);
  for (int i = 0; i < len; i++) {
    buff.append(in.readChar());
  }
  String s = buff.toString();
  s = StringUtils.cache(s);
  return s;
}

代码示例来源:origin: konsoletyper/teavm

public void update() throws IOException {
  symbols.clear();
  symbolMap.clear();
  firstUnstoredIndex = 0;
  try (DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
    while (true) {
      int length = input.read();
      if (length == -1) {
        break;
      }
      length = ((length & 0xFF) << 8) | (input.read() & 0xFF);
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i < length; ++i) {
        sb.append(input.readChar());
      }
      String symbol = sb.toString();
      symbolMap.put(symbol, symbols.size());
      symbols.add(symbol);
      firstUnstoredIndex = symbols.size();
    }
  }
}

代码示例来源:origin: libgdx/libgdx

case RemoteSender.KEY_TYPED:
  keyEvent = new KeyEvent();
  keyEvent.keyChar = in.readChar();
  keyEvent.type = KeyEvent.KEY_TYPED;
  break;

代码示例来源:origin: libgdx/libgdx

case RemoteSender.KEY_TYPED:
  keyEvent = new KeyEvent();
  keyEvent.keyChar = in.readChar();
  keyEvent.type = KeyEvent.KEY_TYPED;
  break;

代码示例来源:origin: robovm/robovm

element.fieldValue = input.readByte();
} else if (type == char.class) {
  element.fieldValue = input.readChar();
} else if (type == short.class) {
  element.fieldValue = input.readShort();

代码示例来源:origin: apache/activemq

/**
 * Reads a Unicode character value from the bytes message stream.
 *
 * @return the next two bytes from the bytes message stream as a Unicode
 *         character
 * @throws JMSException if the JMS provider fails to read the message due to
 *                 some internal error.
 * @throws MessageEOFException if unexpected end of bytes stream has been
 *                 reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 */
@Override
public char readChar() throws JMSException {
  initializeReading();
  try {
    return this.dataIn.readChar();
  } catch (EOFException e) {
    throw JMSExceptionSupport.createMessageEOFException(e);
  } catch (IOException e) {
    throw JMSExceptionSupport.createMessageFormatException(e);
  }
}

代码示例来源:origin: libgdx/libgdx

return parseData(din, type);
else if (type == 'C')
  return new JsonValue(din.readChar());
else
  throw new GdxRuntimeException("Unrecognized data type");

代码示例来源:origin: libgdx/libgdx

return parseData(din, type);
else if (type == 'C')
  return new JsonValue(din.readChar());
else
  throw new GdxRuntimeException("Unrecognized data type");

代码示例来源:origin: apache/activemq

return this.dataIn.readChar();

相关文章