GroupSymbolTableNode { public GroupSymbolTableNode(HdfFileChannel hdfFc, long address) { this.address = address; try { int headerSize = 8; ByteBuffer header = hdfFc.readBufferFromAddress(address, headerSize); byte[] formatSignatureBytes = new byte[4]; header.get(formatSignatureBytes, 0, formatSignatureBytes.length); if (!Arrays.equals(NODE_SIGNATURE, formatSignatureBytes)) { throw new HdfException("Group symbol table Node signature not matched"); } version = header.get(); header.position(6); final byte[] twoBytes = new byte[2]; header.get(twoBytes); numberOfEntries = ByteBuffer.wrap(twoBytes).order(LITTLE_ENDIAN).getShort(); logger.trace("numberOfSymbols = {}", numberOfEntries); final long symbolTableEntryBytes = hdfFc.getSizeOfOffsets() * 2L + 8L + 16L; symbolTableEntries = new SymbolTableEntry[numberOfEntries]; for (int i = 0; i < numberOfEntries; i++) { long offset = address + headerSize + i * symbolTableEntryBytes; symbolTableEntries[i] = new SymbolTableEntry(hdfFc, offset); } } catch (Exception e) { throw new HdfException("Error reading Group symbol table node", e); } } GroupSymbolTableNode(HdfFileChannel hdfFc, long address); short getVersion(); short getNumberOfEntries(); SymbolTableEntry[] getSymbolTableEntries(); @Override String toString();  }
@Test void testGroupSymbolTableNode() { GroupSymbolTableNode node = new GroupSymbolTableNode(hdfFc, 1504); assertThat(node.getVersion(), is(equalTo((short) 1))); assertThat(node.getNumberOfEntries(), is(equalTo((short) 3))); assertThat(node.getSymbolTableEntries().length, is(equalTo(3))); assertThat(node.toString(), is(equalTo("GroupSymbolTableNode [address=1504, numberOfEntries=3]"))); }