public Page page() throws IOException {
        if (eos)
            return (null);
        Page page = new Page();
        while (true) {
            int ret = sync.pageout(page);
            if (ret < 0)
                throw (new OggException()); /* ? */
            if (ret == 1) {
                if (page.eos() != 0)
                    eos = true;
                return (page);
            }
            int off = sync.buffer(4096);
            int len = in.read(sync.data, off, 4096);
            if (len < 0)
                return (null);
            sync.wrote(len);
        }
    }