/** Flushes this output stream and forces any buffered output bytes to be written out. */
 public void flush() {
   super.flush();
   if (data != 0) {
     writeEncodedData();
     try {
       encodedOut.flush();
     } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }