private int readOggNextPage() throws IOException {
       if (eos)
           return -1;

       OggPage op = OggPage.create(sourceStream);
       op.isBos();
       if (op.isEos()){
           eos = true;
           lastPage = op;
       }

       LogicalOggStreamImpl los = (LogicalOggStreamImpl) logicalStreams.get(op.getStreamSerialNumber());
       if (los == null) {
           serialNumber = op.getStreamSerialNumber();
           los = new LogicalOggStreamImpl(this, op.getStreamSerialNumber());
           logicalStreams.put(op.getStreamSerialNumber(), los);
           los.checkFormat(op);
       }

       los.addPageNumberMapping(pageNumber);
       los.addGranulePosition(op.getAbsoluteGranulePosition());

       oggPages.put(pageNumber, op);
       pageNumber++;

       return pageNumber-1;
   }
Implementation of the <code>PhysicalOggStream</code> interface for reading
 and caching an Ogg stream from a URL. This class reads the data as fast as
 possible from the URL, caches it locally either in memory or on disk, and
 supports seeking within the available data.
jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java