code: private boolean resize(int newCapacity) {
          if (outCapacity >= newCapacity) return true;
          byte[] newBuffer = new byte[newCapacity];
          System.arraycopy(buffer, 0, newBuffer, 0, Math.min(outBlurbs + ((outBits != 0) ? 1 : 0), newCapacity));
          if (newCapacity < outBlurbs + ((outBits != 0) ? 1 : 0)) {
              outBlurbs = newCapacity;
              outBits = 0;
              totalBits = newCapacity << 3;
          }
          if (newCapacity < consumedBlurbs + ((consumedBits != 0) ? 1 : 0)) {
              consumedBlurbs = newCapacity;
              consumedBits = 0;
              totalConsumedBits = newCapacity << 3;
          }
          buffer = newBuffer;
          outCapacity = newCapacity;
          return true;
      }
docs: /*
  WATCHOUT: The current implentation is not friendly to shrinking, i.e. it
  does not shift left what is consumed, it just chops off the end, whether
  there is unconsumed data there or not. This is OK because currently we
  never shrink the buffer, but if this ever changes, we'll have to do some
  fixups here.