byte[] tmp = new byte[] { 1, 127, -1, -128, 1, -2};
for (int i = 0; i < tmp.length; i++) {
buffer.append(tmp[i]);
}
assertEquals(8, buffer.capacity());
assertEquals(6, buffer.length());
for (int i = 0; i < tmp.length; i++) {
assertEquals(tmp[i], buffer.byteAt(i));
}