Package org.bardframework.commons.utils
Class BytesUtils
java.lang.Object
org.bardframework.commons.utils.BytesUtils
Created by Vahid Zafari.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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.
-