public void testHandlesMoreThan256Ids() {
int count = 500;
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
HierarchicalStreamWriter binaryWriter = new BinaryStreamWriter(buffer);
binaryWriter.startNode("root");
for (int i = 0; i < count; i++) {
binaryWriter.startNode("node" + i);
binaryWriter.endNode();
}
for (int i = 0; i < count; i++) {
binaryWriter.startNode("node" + i);
binaryWriter.endNode();
}
binaryWriter.endNode();
HierarchicalStreamReader binaryReader
= new BinaryStreamReader(new ByteArrayInputStream(buffer.toByteArray()));
assertEquals("root", binaryReader.getNodeName());
for (int i = 0; i < count; i++) {