code: public static int readMediumInt(IoBuffer in) {
          byte[] bytes = new byte[3];
          in.get(bytes);
          int val = 0;
          val += bytes[0] * 256 * 256;
          val += bytes[1] * 256;
          val += bytes[2];
          if (val < 0) {
              val += 256;
          }
          return val;
      }
docs: Reads a Medium Int to the in buffer
  
  @param in
  Source
  @return int Medium int