How BigInteger convert a byte array to number in Java?

Zizoo

I have this small code :

public static void main(String[] args)  {

    byte[] bytesArray = {7,34};
    BigInteger bytesTointeger= new BigInteger(bytesArray);
    System.out.println(bytesTointeger);

}

Output:1826

My question is what just happened how an array of bytes {7,34} converted into this number 1826 , what is the operation that caused this result ? like how to convert it manually

Pablo Lozano

The number 1826 is, in binary, 11100100010. If you split that in groups of 8 bits, you get the following:

00000111 00100010

Which are the numbers 7 and 34

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to convert specific byte in a byte array to integer

分類Dev

How to convert a string to byte array in bcd format in java?

分類Dev

How to convert a string to byte array in bcd format in java?

分類Dev

How to check if byte array contents form a double number and not a String Java?

分類Dev

How to convert a structure that contains an array to a byte array?

分類Dev

how to convert BYTE array to char array for send with socket c++

分類Dev

Unable to serialize convert java POJO class into a byte array

分類Dev

Cannot convert String to byte array and vice versa in Java

分類Dev

How can I use Python to convert RGB565 byte array to RGB888 byte array?

分類Dev

Convert byte array to hex string

分類Dev

Convert List<Boolean> to byte [ ] array

分類Dev

Convert binary string to byte array

分類Dev

NAudio Convert Byte Array to Wav

分類Dev

How to calculate number of 1 bit's in a BigInteger ?

分類Dev

Java byte array compression

分類Dev

BigIntegerからbyte []

分類Dev

How can I convert byte CP-1252 to byte UTF-8 in java

分類Dev

convert int array to byte array in Golang

分類Dev

How to convert a Byte to a Bitstring in Kotlin?

分類Dev

How to convert wstring into byte vector

分類Dev

how to convert byte pointer to structure

分類Dev

How to convert an observable list to an array list? Java

分類Dev

Convert arbitrary Golang interface to byte array

分類Dev

Convert Word document to pdf byte array in memory

分類Dev

Pack Convert byte array into UINT64

分類Dev

Convert byte array (hex) to signed Int

分類Dev

To convert byte array to mp3 file

分類Dev

Convert number to date in java

分類Dev

creating hex byte array in java

Related 関連記事

ホットタグ

アーカイブ