docs: private static long bytesToLongBE(InputStream input, int n)
              throws IOException
      {
          long out = 0;
          long val;
          while (n > 0) {
              n--;
              // store it in a long and then shift else integer overflow will occur
              val = input.read();
              out |= (val << (n * 8));
          }
          return out;
      }