Here you can find the source of bytes2nibbles(byte[] bytes)
public static byte[] bytes2nibbles(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] bytes2nibbles(byte[] bytes) { byte[] nibb = new byte[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { nibb[i * 2] = (byte) (bytes[i] >> 4); nibb[i * 2 + 1] = (byte) (bytes[i] & 0x0F); }/* w ww.j a v a2s. co m*/ return nibb; } }