/** 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();
     }
   }
 }
 /** Closes this output stream and releases any system resources associated with this stream. */
 public void close() {
   super.close();
   flush();
 }
 /** Constructor */
 private BitEncoderImpl(OutputStream out, int maxBitsWidth) {
   super.setOutputStream(out);
   this.maxBitsWidth = maxBitsWidth;
 }