Package 

Class ImageFormatCheckerUtils

    • Method Summary

      Modifier and Type Method Description
      static Array<byte> asciiBytes(String value) Helper method that transforms provided string into it's byte representation using ASCIIencoding.
      static boolean startsWithPattern(Array<byte> byteArray, Array<byte> pattern) Checks if byteArray interpreted as sequence of bytes starts with pattern starting at positionequal to offset.
      static boolean hasPatternAt(Array<byte> byteArray, Array<byte> pattern, int offset) Checks if byteArray interpreted as sequence of bytes starts with pattern starting at positionequal to offset.
      static int indexOfPattern(Array<byte> byteArray, int byteArrayLen, Array<byte> pattern, int patternLen) Checks if byteArray interpreted as sequence of bytes contains the pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • asciiBytes

         static Array<byte> asciiBytes(String value)

        Helper method that transforms provided string into it's byte representation using ASCIIencoding.

        Parameters:
        value - the string to use
      • startsWithPattern

         static boolean startsWithPattern(Array<byte> byteArray, Array<byte> pattern)

        Checks if byteArray interpreted as sequence of bytes starts with pattern starting at positionequal to offset.

        Parameters:
        byteArray - the byte array to be checked
        pattern - the pattern to check
      • hasPatternAt

         static boolean hasPatternAt(Array<byte> byteArray, Array<byte> pattern, int offset)

        Checks if byteArray interpreted as sequence of bytes starts with pattern starting at positionequal to offset.

        Parameters:
        byteArray - the byte array to be checked
        pattern - the pattern to check
      • indexOfPattern

         static int indexOfPattern(Array<byte> byteArray, int byteArrayLen, Array<byte> pattern, int patternLen)

        Checks if byteArray interpreted as sequence of bytes contains the pattern.

        Parameters:
        byteArray - the byte array to be checked
        pattern - the pattern to check