public static String toBinaryStr(byte[] bs) {

		StringBuilder sb = new StringBuilder();

		for (byte b : bs) {
			String s1 = String.format("%8s", Integer.toBinaryString(b & 0xFF)).replace(' ', '0');
			sb.append(s1);
		}

		return sb.toString();
	}
Converts the given byte array to a binary string.

@param bs
@return
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/util/InstructionSearchUtils.java