granulpos += frameSize*packetCount/2;
granulpos += framesPerPacket * frameSize * packetCount / 2;
  private void writeOggPageChecksum()  {    // write the granulpos    granulpos += frameSize*packetCount/2;    writeLong(buf, count+6, granulpos);    // write the checksum    int chksum = OggCrc.checksum(0, buf, count, oggCount-count);    writeInt(buf, count+22, chksum);    // reset variables for a new page.    count = oggCount;    packetCount = 0;  }