Java Array Starts With startsWith(byte[] bytes, String str, int offset)

Here you can find the source of startsWith(byte[] bytes, String str, int offset)

Description

starts With

License

Open Source License

Declaration

static boolean startsWith(byte[] bytes, String str, int offset) 

Method Source Code

//package com.java2s;

public class Main {
    static boolean startsWith(byte[] bytes, String str, int offset) {
        if (bytes.length < (offset + str.length()))
            return false;

        for (int c = 0; c < str.length(); c++) {
            if (bytes[offset + c] != str.charAt(c))
                return false;
        }//from  w  w  w . j a va  2s. c om

        return true;
    }
}

Related

  1. startsWith(byte a[], int from, byte b[])
  2. startsWith(byte[] arr, int offset, int len, byte[] pattern)
  3. startsWith(byte[] array, byte[] prefix)
  4. startsWith(byte[] array, byte[] startBytes)
  5. startsWith(byte[] bytes, int offset, byte... prefix)
  6. startsWith(byte[] bytes, String text)
  7. startsWith(byte[] checkMe, byte[] maybePrefix)
  8. startsWith(byte[] haystack, byte[] needle)
  9. startsWith(byte[] nameRaw, byte[] namePrefix)