code: @Override
      public void flush() throws IOException
      {
          if ( buf != null && buf.position() > 0 )
          {    
              buf.flip();
              rwChannel.write( buf );
              buf.clear();
          }
      }
docs: /* (non-Javadoc)
  @see java.io.OutputStream#flush()