Here you can find the source of lengthCheck(final byte[] buffer, final byte length)
private static void lengthCheck(final byte[] buffer, final byte length)
//package com.java2s; /**/*w ww . ja va 2 s . co m*/ * jModuleConnect is an framework for communication and file management on modem * modules. * * This project was inspired by the project TC65SH * by Christoph Vilsmeier: <http://www.vilsmeier-consulting.de/tc65sh.html> * * Copyright (C) 2015 sitec systems GmbH <http://www.sitec-systems.de> * * This file is part of jModuleConnect. * * jModuleConnect is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your option) * any later version. * * jModuleConnect is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with jModuleConnect. If not, see <http://www.gnu.org/licenses/>. */ public class Main { private static void lengthCheck(final byte[] buffer, final byte length) { if (buffer.length != length) { throw new IllegalArgumentException("buffer length must be " + length + " bytes"); } } }