本文整理了Java中org.apache.jackrabbit.oak.commons.IOUtils.writeInt()
方法的一些代码示例,展示了IOUtils.writeInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.writeInt()
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.commons.IOUtils
类名称:IOUtils
方法名:writeInt
[英]Write an integer (4 bytes).
[中]写入一个整数(4字节)。
代码示例来源:origin: apache/jackrabbit-oak
/**
* Write a long (8 bytes).
*
* @param out the output stream
* @param x the value
* @throws IOException if an IO exception occurred while writing.
*/
public static void writeLong(OutputStream out, long x) throws IOException {
writeInt(out, (int) (x >>> 32));
writeInt(out, (int) x);
}
代码示例来源:origin: org.apache.jackrabbit/oak-commons
/**
* Write a long (8 bytes).
*
* @param out the output stream
* @param x the value
* @throws IOException if an IO exception occurred while writing.
*/
public static void writeLong(OutputStream out, long x) throws IOException {
writeInt(out, (int) (x >>> 32));
writeInt(out, (int) x);
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
/**
* Write a long (8 bytes).
*
* @param out the output stream
* @param x the value
* @throws IOException if an IO exception occurred while writing.
*/
public static void writeLong(OutputStream out, long x) throws IOException {
writeInt(out, (int) (x >>> 32));
writeInt(out, (int) x);
}
代码示例来源:origin: apache/jackrabbit-oak
private static void testInt(int x) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.writeInt(out, x);
byte[] data = out.toByteArray();
assertTrue(data.length == Integer.BYTES);
ByteArrayInputStream in = new ByteArrayInputStream(data);
int x2 = IOUtils.readInt(in);
assertEquals(x, x2);
assertEquals(-1, in.read());
}
内容来源于网络,如有侵权,请联系作者删除!