I have to write 7 byte Integer value to DataOutputStream, this Integer contains 15 digits. How can I do that?
I have to write 7 byte Integer value to DataOutputStream, this Integer contains 15
Share
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.
7 bytes = 56 bits
that means you can represent numbers up to 2^56 which is more than necessary for 15 digit long numbers.
just convert the number to binary and store it in those 7 bytes that you’re sending.