ByteCoder.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:beam 作者:
@Override
public Byte decode(InputStream inStream)
    throws IOException, CoderException {
  try {
    // value will be between 0-255, -1 for EOF
    int value = inStream.read();
    if (value == -1) {
      throw new EOFException("EOF encountered decoding 1 byte from input stream");
    }
    return (byte) value;
  } catch (EOFException | UTFDataFormatException exn) {
    // These exceptions correspond to decoding problems, so change
    // what kind of exception they're branded as.
    throw new CoderException(exn);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号