protected function encodeInteger($value, $length) {
        $format = "%'.0" . $length . "d";
        $output = null === $value ? "" : sprintf($format, $value);
        if ($length < strlen($output)) {
            throw new TooLongDataException($value, $length);
        }
        return $output;
    }
protected function encodeInteger($value, $length) {
        $format = "%'.0" . $length . "d";
        $output = null === $value ? "" : sprintf($format, $value);
        if ($length < strlen($output)) {
            throw new TooLongDataException($value, $length);
        }
        return $output;
    }
protected function encodeInteger ( $ value , $ length ) { $ format = "%'.0" . $ length . "d" ; $ output = null === $ value ? "" : sprintf ( $ format , $ value ) ; if ( $ length < strlen ( $ output ) ) { throw new TooLongDataException ( $ value , $ length ) ; } return $ output ; }
Encode an integer value.

@param int $value The value.
@param int $length The length.
@return string Returns the encoded integer.
@throws TooLongDataException Throws a too long data exception if the value exceeds the length.
Encode an integer value .