if I have a byte [] which holds string in this format:
abcd 546546545 dfdsfdsfd 5415645
and I know the numbers are of type integer. What is the best way to get a raw byte[] out of it, wihtout using String.split() method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This answer is based on the following assumptions (none of which are clearly warranted from what you have posted):
byte[]where each byte contains the numeric value corresponding to the decimal digits found in the fileWith these assumptions, I would solve this problem as follows:
In Java 7, I’d use the try-with-resources statement: