public void testLong() throws IOException {
ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(1024);
long[] numbers={Long.MIN_VALUE, -322649, -500, 0, 1, 100, 322649, Long.MAX_VALUE};
for(long i: numbers)
out.writeLong(i);
ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
for(long i: numbers) {
long num=in.readLong();
assert num == i;
}