code: public void pad(int width) throws JSONException {
          try {
              this.bitwriter.pad(width);
          } catch (Throwable e) {
              throw new JSONException(e);
          }
      }
docs: Pad the output to fill an allotment of bits.
  
  @param width
  The size of the bit allotment. A value of 8 will complete and
  flush the current byte. If you don't pad, then some of the
  last bits might not be sent to the Output Stream.
  @throws JSONException