code: public void writeNBit(long value, int n) throws IOException {
          for (int i = 0; i < n; i++) {
              write1Bit((int) (value >> (n - i - 1)) & 0x1);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see ua.org.jplayer.javcodec.h264.H264BitOutputStream#writeNBit(long,
  int)