Java Array Starts With startsWith(byte[] target, int offset, byte[] litmusPaper)

Here you can find the source of startsWith(byte[] target, int offset, byte[] litmusPaper)

Description

starts With

License

Apache License

Declaration

public static boolean startsWith(byte[] target, int offset, byte[] litmusPaper) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean startsWith(byte[] target, int offset, byte[] litmusPaper) {
        if ((target.length - offset) < litmusPaper.length) {
            return false;
        }/* w w  w  . j a  va 2 s .  com*/
        for (int i = offset, j = 0; j < litmusPaper.length; i++, j++) {
            if (target[i] != litmusPaper[j]) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. startsWith(byte[] prefix, byte[] source)
  2. startsWith(byte[] source, byte[] match)
  3. startsWith(byte[] source, byte[] match)
  4. startsWith(byte[] source, int offset, byte[] match)
  5. startsWith(byte[] target, byte[] search, int offset)
  6. startsWith(char s[], int len, String prefix)
  7. startsWith(char[] prefix, char[] other)
  8. startsWith(char[] src, char[] find, int startAt)
  9. startsWith(char[] str1, String str2)