code: public void close() throws IOException {
          if(buffer.size() > 0) {
              buffer.get( buffer.size()-1 ).setIsEOS();
          } else {
              OggPacket p = new OggPacket(new byte[0]);
              p.setIsEOS();
              bufferPacket(p);
          }
          flush();
  
          closed = true;
      }
docs: Writes all pending packets to the stream,
  with the last one containing the End Of Stream
  Flag, and then closes down.