public static int writeOggPageHeader(byte[] buf,int offset,int headerType,long granulepos,int streamSerialNumber,int pageCount,int packetCount,byte[] packetSizes){
  writeString(buf,offset,"OggS");
  buf[offset + 4]=0;
  buf[offset + 5]=(byte)headerType;
  writeLong(buf,offset + 6,granulepos);
  writeInt(buf,offset + 14,streamSerialNumber);
  writeInt(buf,offset + 18,pageCount);
  writeInt(buf,offset + 22,0);
  buf[offset + 26]=(byte)packetCount;
  System.arraycopy(packetSizes,0,buf,offset + 27,packetCount);
  return packetCount + 27;
}

public static int writeOggPageHeader ( byte [ ] buf , int offset , int headerType , long granulepos , int streamSerialNumber , int pageCount , int packetCount , byte [ ] packetSizes ) { writeString ( buf , offset , "OggS" ) ; buf [ offset + 4 ] = 0 ; buf [ offset + 5 ] = ( byte ) headerType ; writeLong ( buf , offset + 6 , granulepos ) ; writeInt ( buf , offset + 14 , streamSerialNumber ) ; writeInt ( buf , offset + 18 , pageCount ) ; writeInt ( buf , offset + 22 , 0 ) ; buf [ offset + 26 ] = ( byte ) packetCount ; System . arraycopy ( packetSizes , 0 , buf , offset + 27 , packetCount ) ; return packetCount + 27 ; }
writes an ogg page header to the given byte array .
