src/doge/data/Patch.java
public static Patch parsePatch(String line, Function function) {
        String[] splitted = line.split(PATCH_DELIMITER_REGEX);

        int parsedOffset =
                Integer.parseInt(splitted[PATCH_OFFSET_INDEX], 16) - function.getFunctionOffset();
        String trimmedLengthString = splitted[PATCH_LENGTH_INDEX].substring(2);
        int parsedLength = Integer.parseInt(trimmedLengthString, 16);

        byte[] parsedOriginalBytes = new byte[parsedLength];
        byte[] parsedNewBytes = new byte[parsedLength];

        for (int i = 0; i < parsedLength; i++) {
            parsedOriginalBytes[i] = (byte) Integer.parseInt(splitted[BYTES_START_INDEX + i], 16);
            parsedNewBytes[i] = (byte) Integer
                    .parseInt(splitted[BYTES_START_INDEX + i + parsedLength], 16);
        }

        return new Patch(function, parsedOffset, parsedLength, parsedOriginalBytes, parsedNewBytes);
    }
/**
     * Return a Patch object from a patch string (line)
     *
     * @param line the patch string
     * @param function the Function object containing the function that will be applied the patch
     * @return the Patch object
     */
Return a Patch object from a patch string (line)
@param line the patch string
@param function the Function object containing the function that will be applied the patch
@return the Patch object
Return a Patch object from a patch string ( line ) @param line the patch string @param function the Function object containing the function that will be applied the patch @return the Patch object
public static Patch parsePatch(String line, Function function) {
        String[] splitted = line.split(PATCH_DELIMITER_REGEX);
        int parsedOffset =
                Integer.parseInt(splitted[PATCH_OFFSET_INDEX], 16) - function.getFunctionOffset();
        String trimmedLengthString = splitted[PATCH_LENGTH_INDEX].substring(2);
        int parsedLength = Integer.parseInt(trimmedLengthString, 16);
        byte[] parsedOriginalBytes = new byte[parsedLength];
        byte[] parsedNewBytes = new byte[parsedLength];
        for (int i = 0; i < parsedLength; i++) {
            parsedOriginalBytes[i] = (byte) Integer.parseInt(splitted[BYTES_START_INDEX + i], 16);
            parsedNewBytes[i] = (byte) Integer
                    .parseInt(splitted[BYTES_START_INDEX + i + parsedLength], 16);
        }
        return new Patch(function, parsedOffset, parsedLength, parsedOriginalBytes, parsedNewBytes);
    }
public static Patch parsePatch ( String line , Function function ) { String [ ] splitted = line . split ( PATCH_DELIMITER_REGEX ) ; int parsedOffset = Integer . parseInt ( splitted [ PATCH_OFFSET_INDEX ] , 16 ) - function . getFunctionOffset ( ) ; String trimmedLengthString = splitted [ PATCH_LENGTH_INDEX ] . substring ( 2 ) ; int parsedLength = Integer . parseInt ( trimmedLengthString , 16 ) ; byte [ ] parsedOriginalBytes = new byte [ parsedLength ] ; byte [ ] parsedNewBytes = new byte [ parsedLength ] ; for ( int i = 0 ; i < parsedLength ; i ++ ) { parsedOriginalBytes [ i ] = ( byte ) Integer . parseInt ( splitted [ BYTES_START_INDEX + i ] , 16 ) ; parsedNewBytes [ i ] = ( byte ) Integer . parseInt ( splitted [ BYTES_START_INDEX + i + parsedLength ] , 16 ) ; } return new Patch ( function , parsedOffset , parsedLength , parsedOriginalBytes , parsedNewBytes ) ; }
Return a Patch object from a patch string (line)
 @param line the patch string
 @param function the Function object containing the function that will be applied the patch
 @return the Patch object
Return a Patch object from a patch string ( line ) @param line the patch string @param function the Function object containing the function that will be applied the patch @return the Patch object