code: public void writeIntLenenc(final long value) {
          if (value < 0xfb) {
              byteBuf.writeByte((int) value);
              return;
          }
          if (value < Math.pow(2, 16)) {
              byteBuf.writeByte(0xfc);
              byteBuf.writeShortLE((int) value);
              return;
          }
          if (value < Math.pow(2, 24)) {
              byteBuf.writeByte(0xfd);
              byteBuf.writeMediumLE((int) value);
              return;
          }
          byteBuf.writeByte(0xfe);
          byteBuf.writeLongLE(value);
      }
docs: Write lenenc integer to byte buffers.
  
  @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger">LengthEncodedInteger</a>
  
  @param value lenenc integer