Here you can find the source of bitLength(final int byteLength)
Parameter | Description |
---|---|
byteLength | The byte length. |
public static int bitLength(final int byteLength)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w . j av a 2 s . co m*/ * Returns the bit length of the specified byte length. * * @param byteLength The byte length. * * @return The bit length. */ public static int bitLength(final int byteLength) { return byteLength * 8; } /** * Returns the byte length of the specified byte array. * * @param byteArray The byte array. May be {@code null}. * * @return The bite length, zero if the array is {@code null}. */ public static int bitLength(final byte[] byteArray) { if (byteArray == null) { return 0; } else { return bitLength(byteArray.length); } } }