code: public final long getPackedLong(final int pos) {
          final int lead = getUint8(pos);
          if (lead < 251) return lead;
  
          switch (lead) {
              case 251:
                  return NULL_LENGTH;
              case 252:
                  return getUint16(pos + 1);
              case 253:
                  return getUint24(pos + 1);
              default: /* Must be 254 when here */
                  return getUint32(pos + 1);
          }
      }
docs: Return packed number from buffer. (little-endian) A Packed Integer has
  the capacity of storing up to 8-byte integers, while small integers still
  can use 1, 3, or 4 bytes. The value of the first byte determines how to
  read the number, according to the following table.
  <ul>
  <li>0-250 The first byte is the number (in the range 0-250). No
  additional bytes are used.</li>
  <li>252 Two more bytes are used. The number is in the range 251-0xffff.</li>
  <li>253 Three more bytes are used. The number is in the range
  0xffff-0xffffff.</li>
  <li>254 Eight more bytes are used. The number is in the range
  0xffffff-0xffffffffffffffff.</li>
  </ul>
  That representation allows a first byte value of 251 to represent the SQL
  NULL value.