本文整理了Java中org.apache.jackrabbit.oak.commons.IOUtils.writeVarLong()
方法的一些代码示例,展示了IOUtils.writeVarLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.writeVarLong()
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.commons.IOUtils
类名称:IOUtils
方法名:writeVarLong
[英]Write a variable size long. Negative values need 10 bytes.
[中]写一个可变大小的长文件。负值需要10个字节。
代码示例来源:origin: org.apache.jackrabbit/oak-mk
@Override
public void write(String key, long value) throws Exception {
if (out == null) {
throw new IllegalStateException("no OutputStream provided");
}
IOUtils.writeVarLong(out, value);
}
代码示例来源:origin: org.apache.jackrabbit/oak-blob
idStream.write(TYPE_HASH);
IOUtils.writeVarInt(idStream, 0);
IOUtils.writeVarLong(idStream, length);
byte[] digest = messageDigest.digest();
File f = getFile(digest, false);
代码示例来源:origin: apache/jackrabbit-oak
idStream.write(TYPE_HASH);
IOUtils.writeVarInt(idStream, 0);
IOUtils.writeVarLong(idStream, length);
byte[] digest = messageDigest.digest();
File f = getFile(digest, false);
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
idStream.write(TYPE_HASH);
IOUtils.writeVarInt(idStream, 0);
IOUtils.writeVarLong(idStream, length);
byte[] digest = messageDigest.digest();
File f = getFile(digest, false);
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
IOUtils.writeVarLong(idStream, totalLength);
IOUtils.writeVarLong(idStream, blockLen);
totalLength += blockLen;
IOUtils.writeVarInt(idStream, digest.length);
代码示例来源:origin: apache/jackrabbit-oak
IOUtils.writeVarLong(idStream, totalLength);
IOUtils.writeVarLong(idStream, blockLen);
totalLength += blockLen;
IOUtils.writeVarInt(idStream, digest.length);
代码示例来源:origin: org.apache.jackrabbit/oak-blob
IOUtils.writeVarLong(idStream, totalLength);
IOUtils.writeVarLong(idStream, blockLen);
totalLength += blockLen;
IOUtils.writeVarInt(idStream, digest.length);
代码示例来源:origin: apache/jackrabbit-oak
private static void testVarLong(long x, int expectedLen) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.writeVarLong(out, x);
byte[] data = out.toByteArray();
assertTrue(data.length <= 10);
if (expectedLen > 0) {
assertEquals(expectedLen, data.length);
}
ByteArrayInputStream in = new ByteArrayInputStream(data);
long x2 = IOUtils.readVarLong(in);
assertEquals(x, x2);
assertEquals(-1, in.read());
}
内容来源于网络,如有侵权,请联系作者删除!