code: private void decode(boolean last) throws IOException {
          buf.flip();
          while(true) {
              CoderResult r = decoder.decode(buf, out, last);
              if(r==CoderResult.OVERFLOW) {
                  flushOutput();
                  continue;
              }
              if(r==CoderResult.UNDERFLOW) {
                  buf.compact();
                  return;
              }
              // otherwise treat it as an error
              r.throwException();
          }
      }
docs: Decodes the contents of {@link #buf} as much as possible to {@link #out}.
  If necessary {@link #out} is further sent to {@link #writer}.
  
  <p>
  When this method returns, the {@link #buf} is back to the 'accumulation'
  mode.
  
  @param last
  if true, tell the decoder that all the input bytes are ready.