public void encode(){
    
    int k = 0;
    int i = 1; //start of plaintext in audioBytes
    int pt;
    byte pb;
    
    System.out.println("Hiding the ciphertext in AU file ...");
    // First encode the length of the plaintext
    pt = cipherbuff.length;
    for (int j=1; j<=32; j++) {
      if ((pt & 0x80000000)!=0) // MSB of pt is '1'
	  audioBytes[i] = (byte)(audioBytes[i] | 0x01);
	else if ((audioBytes[i] & 0x01)!=0){ //MSB of pt '0' and lsb of audio '1'
	  audioBytes[i] = (byte)(audioBytes[i] >>> 1);
	  audioBytes[i] = (byte)(audioBytes[i] << 1);
	}//if
	pt = (int)(pt << 1);
	i++;
    }
    
    // Now start encoding the message itself!
    //ptext.getChars(0, ptext.length(), cleartext, 0);
    while (k < cipherbuff.length){
      pb = cipherbuff[k];
      //System.out.print((char)pt);
      for (int j=1; j<=8; j++) {
	if ((pb & 0x80)!=0) // MSB of pb is '1'
	  audioBytes[i] = (byte)(audioBytes[i] | 0x01);
	else if ((audioBytes[i] & 0x01)!=0){ //MSB of pt '0' and lsb of audio '1'
	  audioBytes[i] = (byte)(audioBytes[i] >>> 1);
	  audioBytes[i] = (byte)(audioBytes[i] << 1);
	}//if
	pb = (byte)(pb << 1);
	i++;
      }//for j
      k++;
    }//while k
    System.out.println();
    // now write the byte array to an audio file
    File fileOut = new File(outFile);
    ByteArrayInputStream byteIS = new ByteArrayInputStream(audioBytes);
    AudioInputStream audioIS = new AudioInputStream(byteIS, 
    		audioInputStream.getFormat(), audioInputStream.getFrameLength());
    if (AudioSystem.isFileTypeSupported(AudioFileFormat.Type.AU, 
      					  audioIS)) {
	try {
	AudioSystem.write(audioIS, AudioFileFormat.Type.AU, fileOut);
	System.out.println("Steganographed AU file is written as " + outFile +"...");
	} catch(Exception e) {
	  System.err.println("Sound File write error");
	}
     }//if
  }//encode