code: private static int parseNanos(long serialized)
      {
          int zeros = ((int) serialized) & 0b111;
          int result = (int) (serialized >>> 3);
          if (zeros != 0) {
              for (int i = 0; i <= zeros; ++i) {
                  result *= 10;
              }
          }
          return result;
      }
docs: This comes from the Apache Hive ORC code