Here you can find the source of memcmp(final byte[] first, final int firstStart, final byte[] second, final int secondStart, int size)
public static int memcmp(final byte[] first, final int firstStart, final byte[] second, final int secondStart, int size)
//package com.java2s; /*/*from ww w . j a va 2 s .co m*/ * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. This * code is released under a tri EPL/GPL/LGPL license. You can use it, * redistribute it and/or modify it under the terms of the: * * Eclipse Public License version 1.0, or * GNU General Public License version 2, or * GNU Lesser General Public License version 2.1. */ public class Main { public static int memcmp(final byte[] first, final int firstStart, final byte[] second, final int secondStart, int size) { assert firstStart + size <= first.length; assert secondStart + size <= second.length; int cmp; for (int i = 0; i < size; i++) { if ((cmp = (first[firstStart + i] & 0xff) - (second[secondStart + i] & 0xff)) != 0) { return cmp; } } return 0; } }