Package org.bardframework.commons.utils
Class BytesUtils
- java.lang.Object
-
- org.bardframework.commons.utils.BytesUtils
-
public final class BytesUtils extends Object
Created by Vahid Zafari.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intindexOf(byte[] src, byte[] search)Returns the index within src of the first occurrence of the specified search bytes.static booleanisExist(byte[] src, byte[] search)static byte[]replace(byte[] src, byte[] find, byte[] replace)find and replace must have same size
-
-
-
Method Detail
-
replace
public static byte[] replace(byte[] src, byte[] find, byte[] replace)find and replace must have same size- Returns:
- copy of src, replace bytes if found and possible
-
indexOf
public static int indexOf(byte[] src, byte[] search)Returns the index within src of the first occurrence of the specified search bytes. If no such value ofkexists, then-1is returned.- Parameters:
search- the bytes to search for.- Returns:
- the index of the first occurrence of the specified bytes, or
-1if there is no such occurrence.
-
isExist
public static boolean isExist(byte[] src, byte[] search)- Parameters:
search- the bytes to search for.- Returns:
- true if the specified bytes exist in src, or
falseif there is no such occurrence.
-
-