public class

ImageFormatCheckerUtils

extends Object
java.lang.Object
   ↳ com.facebook.imageformat.ImageFormatCheckerUtils

Class Overview

ImageFormatChecker utility methods

Summary

Public Methods
static byte[] asciiBytes(String value)
Helper method that transforms provided string into it's byte representation using ASCII encoding.
static int indexOfPattern(byte[] byteArray, int byteArrayLen, byte[] pattern, int patternLen)
Checks if byteArray interpreted as sequence of bytes contains the pattern.
static boolean startsWithPattern(byte[] byteArray, byte[] pattern)
Checks if byteArray interpreted as sequence of bytes starts with pattern starting at position equal to offset.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static byte[] asciiBytes (String value)

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

Parameters
value the string to use
Returns
  • byte array representing ascii encoded value

public static int indexOfPattern (byte[] byteArray, int byteArrayLen, 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
Returns
  • index of beginning of pattern, if found; otherwise -1

public static boolean startsWithPattern (byte[] byteArray, byte[] pattern)

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

Parameters
byteArray the byte array to be checked
pattern the pattern to check
Returns
  • true if byteArray starts with pattern