private DcxHeader readDcxHeader(final ByteSource byteSource) throws ImagingException, IOException {
        try (InputStream is = byteSource.getInputStream()) {
            final int id = read4Bytes("Id", is, "Not a Valid DCX File", getByteOrder());
            final int size = 1024;
            final List<Long> pageTable = Allocator.arrayList(size);
            for (int i = 0; i < size; i++) {
                final long pageOffset = 0xFFFFffffL & read4Bytes("PageTable", is, "Not a Valid DCX File", getByteOrder());
                if (pageOffset == 0) {
                    break;
                }
                pageTable.add(pageOffset);
            }

            if (id != DcxHeader.DCX_ID) {
                throw new ImagingException("Not a Valid DCX File: file id incorrect");
            }
            if (pageTable.size() == size) {
                throw new ImagingException("DCX page table not terminated by zero entry");
            }

            final long[] pages = pageTable.stream().mapToLong(Long::longValue).toArray();
            return new DcxHeader(id, pages);
        }
    }
Constructs a new instance with the little-endian byte order.
src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java