public static void fastDeserialize64(
      final long inputDecimal64Long, final int inputScale,
      FastHiveDecimal fastResult) {

    long decimal64Long;
    if (inputDecimal64Long == 0) {
      fastResult.fastReset();
      return;
    } else if (inputDecimal64Long > 0) {
      fastResult.fastSignum = 1;
      decimal64Long = inputDecimal64Long;
    } else {
      fastResult.fastSignum = -1;
      decimal64Long = -inputDecimal64Long;
    }

    // Trim trailing zeroes -- but only below the decimal point.
    int trimScale = inputScale;
    while (trimScale > 0 && decimal64Long % 10 == 0) {
      decimal64Long /= 10;
      trimScale--;
    }

    fastResult.fast2 = 0;
    fastResult.fast1 = decimal64Long / MULTIPLER_LONGWORD_DECIMAL;
    fastResult.fast0 = decimal64Long % MULTIPLER_LONGWORD_DECIMAL;

    fastResult.fastScale = trimScale;

    fastResult.fastIntegerDigitCount =
        Math.max(0, fastRawPrecision(fastResult) - fastResult.fastScale);
  }
*********************************************************************************************
  // Emulate SerializationUtils Serialization used by ORC.

  /**
Write the value of this decimal just like SerializationUtils.writeBigInteger.  It header
comments are:

    Write the arbitrarily sized signed BigInteger in vint format.

    Signed integers are encoded using the low bit as the sign bit using zigzag
    encoding.

    Each byte uses the low 7 bits for data and the high bit for stop/continue.

    Bytes are stored LSB first.

NOTE:
   SerializationUtils.writeBigInteger sometimes pads the result with extra zeroes due to
   BigInteger.bitLength -- we do not emulate that.  SerializationUtils.readBigInteger will
   produce the same result for both.

@param outputStream the stream to write to
@param fastSignum the sign digit (-1, 0, or +1)
@param fast0 word 0 of the internal representation
@param fast1 word 1 of the internal representation
@param fast2 word 2 of the internal representation
@param fastIntegerDigitCount unused
@param fastScale unused
@param scratchLongs scratch space
@return True if the decimal was successfully serialized into the output stream.
@throws IOException for problems in writing
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java