private ByteBuffer writeHeaderToBuffer(int padding,int size) throws IOException {
  compression=false;
  ByteBuffer headerBuffer=ByteBuffer.allocate(TAG_HEADER_LENGTH);
  headerBuffer.put(TAG_ID);
  headerBuffer.put(getMajorVersion());
  headerBuffer.put(getRevision());
  byte flags=(byte)0;
  if (unsynchronization) {
    flags|=(byte)MASK_V22_UNSYNCHRONIZATION;
  }
  if (compression) {
    flags|=(byte)MASK_V22_COMPRESSION;
  }
  headerBuffer.put(flags);
  headerBuffer.put(ID3SyncSafeInteger.valueToBuffer(padding + size));
  headerBuffer.flip();
  return headerBuffer;
}

private ByteBuffer writeHeaderToBuffer ( int padding , int size ) throws IOException { compression = false ; ByteBuffer headerBuffer = ByteBuffer . allocate ( TAG_HEADER_LENGTH ) ; headerBuffer . put ( TAG_ID ) ; headerBuffer . put ( getMajorVersion ( ) ) ; headerBuffer . put ( getRevision ( ) ) ; byte flags = ( byte ) 0 ; if ( unsynchronization ) { flags |= ( byte ) MASK_V22_UNSYNCHRONIZATION ; } if ( compression ) { flags |= ( byte ) MASK_V22_COMPRESSION ; } headerBuffer . put ( flags ) ; headerBuffer . put ( ID3SyncSafeInteger . valueToBuffer ( padding + size ) ) ; headerBuffer . flip ( ) ; return headerBuffer ; }
write the id3 header to the bytebuffer .
