docs: public long unpackLong()
              throws IOException
      {
          byte b = readByte();
          if (Code.isFixInt(b)) {
              return (long) b;
          }
          switch (b) {
              case Code.UINT8: // unsigned int 8
                  byte u8 = readByte();
                  return (long) (u8 & 0xff);
              case Code.UINT16: // unsigned int 16
                  short u16 = readShort();
                  return (long) (u16 & 0xffff);
              case Code.UINT32: // unsigned int 32
                  int u32 = readInt();
                  if (u32 < 0) {
                      return (long) (u32 & 0x7fffffff) + 0x80000000L;
                  }
                  else {
                      return (long) u32;
                  }
              case Code.UINT64: // unsigned int 64
                  long u64 = readLong();
                  if (u64 < 0L) {
                      throw overflowU64(u64);
                  }
                  return u64;
              case Code.INT8: // signed int 8
                  byte i8 = readByte();
                  return (long) i8;
              case Code.INT16: // signed int 16
                  short i16 = readShort();
                  return (long) i16;
              case Code.INT32: // signed int 32
                  int i32 = readInt();
                  return (long) i32;
              case Code.INT64: // signed int 64
                  long i64 = readLong();
                  return i64;
          }
          throw unexpected("Integer", b);
      }