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 to 3 is an reference id , 4 to 9 is a date value. The following data in an byte array is a date value. i want to convert it to string
byte[] b= {48,48,49,48,48,52}; // when converted to string it becomes 10042.
new String(b); // current approach
is there any way to efficiently to convert byte array of some range (Arrays.copyOfRange(b,0,5)
) to string .
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…