java storage unit conversion

1KB=1024B;

 

1MB=1024KB=1024×1024B。

 

1B (byte, byte bai) = 8 bit (see below);

 

1KB (Kilobyte, kilobytes)=1024B= 2^10 B;

 

1MB (Megabyte, megabytes, du megabytes, abbreviated as "Megabyte") = 1024KB = 2^20 B;

 

1GB (Gigabyte, gigabyte, one billion bytes, also known as "gigabyte") = 1024MB = 2^30 B;

 

1TB (Terabyte, trillion bytes, terabytes) = 1024GB = 2^40 B;

 

 

Extended information:

 

concerned department:

 

1. B and bit:

 

Data storage is based on "byte" (Byte), data transmission is mostly based on "bit" (also known as "bit") as the unit, a bit represents a 0 or 1 (that is, binary), every 8 Bit (bit, abbreviated as b) forms a byte (Byte, abbreviated as B), which is the smallest unit of information.

 

2 、 B 与 iB :

 

1KiB (Kibibyte) = 1024byte

 

1KB(Kilobyte)=1000byte

 

1MiB(Mebibyte)=1048576byte

 

1MB(Megabyte)=1000000byte

 

type of data:

 

Byte data type (byte type) is stored in one byte (Byte), which can distinguish 256 numbers, and the value range: 0 to 255. Byte is an unsigned type from 0-255, so it cannot represent negative numbers.

Guess you like

Origin blog.csdn.net/qq_39999478/article/details/107495405