本文整理了Java中org.apache.jackrabbit.oak.commons.IOUtils.writeString()
方法的一些代码示例,展示了IOUtils.writeString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.writeString()
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.commons.IOUtils
类名称: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) {
内容来源于网络,如有侵权,请联系作者删除!