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

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

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

IOUtils.writeString介绍

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

代码示例

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

@Override
public void write(String key, String value) throws Exception {
  if (out == null) {
    throw new IllegalStateException("no OutputStream provided");
  }
  IOUtils.writeString(out, value);
}

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

@Override
public void writeMap(String key, int count, StringEntryIterator iterator) throws Exception {
  if (out == null) {
    throw new IllegalStateException("no OutputStream provided");
  }
  IOUtils.writeVarInt(out, count);
  while (iterator.hasNext()) {
    StringEntry entry = iterator.next();
    IOUtils.writeString(out, entry.getKey());
    IOUtils.writeString(out, entry.getValue());
  }
}

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

@Override
public void writeMap(String key, int count, BytesEntryIterator iterator) throws Exception {
  if (out == null) {
    throw new IllegalStateException("no OutputStream provided");
  }
  IOUtils.writeVarInt(out, count);
  while (iterator.hasNext()) {
    BytesEntry entry = iterator.next();
    IOUtils.writeString(out, entry.getKey());
    IOUtils.writeBytes(out, entry.getValue());
  }
}

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

IOUtils.writeString(out, s);
byte[] data = out.toByteArray();
ByteArrayInputStream in = new ByteArrayInputStream(data) {

相关文章