I have a byte array of 151 bytes which is typically a record, The record needs to inserted in to a oracle database. In 151 byte of array range from 0 to 1 is a record id , 2
and here fantastic way (not efficient) :)
byte[] b = { 48, 48, 49, 48, 48, 52 }; ByteArrayInputStream bais = new ByteArrayInputStream(b); BufferedReader buf = new BufferedReader(new InputStreamReader(bais)); String s = buf.readLine(); System.out.println(s);