org.apache.jackrabbit.oak.commons.IOUtils.readString()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(155)

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

IOUtils.readString介绍

[英]Read a String. This will first read the length as 4 bytes, and then the UTF-8 encoded string.
[中]读一个字符串。这将首先读取长度为4字节,然后读取UTF-8编码字符串。

代码示例

代码示例来源:origin: org.apache.jackrabbit/oak-mk

@Override
public String readStringValue(String key) throws Exception {
  if (in == null) {
    throw new IllegalStateException("no InputStream provided");
  }
  return IOUtils.readString(in);
}

代码示例来源:origin: org.apache.jackrabbit/oak-mk

public StringEntry next() {
  if (count-- > 0) {
    try {
      String key = IOUtils.readString(in);
      String value = IOUtils.readString(in);
      return new StringEntry(key, value);
    } catch (IOException e) {
      throw new RuntimeException("deserialization failed", e);                       
    }
  }
  throw new NoSuchElementException();
}

代码示例来源:origin: org.apache.jackrabbit/oak-mk

public BytesEntry next() {
  if (count-- > 0) {
    try {
      String key = IOUtils.readString(in);
      byte[] value = IOUtils.readBytes(in);
      return new BytesEntry(key, value);
    } catch (IOException e) {
      throw new RuntimeException("deserialization failed", e);
    }
  }
  throw new NoSuchElementException();
}

代码示例来源:origin: apache/jackrabbit-oak

String t = IOUtils.readString(in);
  assertEquals(s, t);
  assertEquals(-1, in.read());
  IOUtils.readString(in);
  fail();
} catch (EOFException e) {

相关文章