java 数据类型
Literals
8bit 1byte byte
16bit 2byte short
32bit 4byte int
64bit 8byte long
http://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.2.1
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
The values of the integral types are integers in the following ranges:
-
For
long
, from -9223372036854775808 to 9223372036854775807, inclusive -
For
char
, from'\u0000'
to'\uffff'
inclusive, that is, from 0 to 65535
0x0000 - 0xffff 0-65535
0x0000 - 0xFFFF 0-65535
1个byte可以表示的常见字符:
try { Appender appender = new Appender(new File("D://bytes.txt")); for (int i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; i++) { appender.follow((char) i + ""); } appender.close(); } catch (IOException e) { e.printStackTrace(); }
如下(包含空格):
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
使用场景:aes-128 的 key 是 ngrJhBXugRakhDvM 刚好16个字符,也刚好转成长度16的byte数组
-128 タ -127 チ -126 ツ -125 テ -124 ト -123 ナ -122 ニ -121 ヌ -120 ネ -119 ノ -118 ハ -117 ヒ -116 フ -115 ヘ -114 ホ -113 マ -112 ミ -111 ム -110 メ -109 モ -108 ヤ -107 ユ -106 ヨ -105 ラ -104 リ -103 ル -102 レ -101 ロ -100 ワ -99 ン -98 ゙ -97 ゚ -96 ᅠ -95 ᄀ -94 ᄁ -93 ᆪ -92 ᄂ -91 ᆬ -90 ᆭ -89 ᄃ -88 ᄄ -87 ᄅ -86 ᆰ -85 ᆱ -84 ᆲ -83 ᆳ -82 ᆴ -81 ᆵ -80 ᄚ -79 ᄆ -78 ᄇ -77 ᄈ -76 ᄡ -75 ᄉ -74 ᄊ -73 ᄋ -72 ᄌ -71 ᄍ -70 ᄎ -69 ᄏ -68 ᄐ -67 ᄑ -66 ᄒ -65 -64 -63 -62 ᅡ -61 ᅢ -60 ᅣ -59 ᅤ -58 ᅥ -57 ᅦ -56 -55 -54 ᅧ -53 ᅨ -52 ᅩ -51 ᅪ -50 ᅫ -49 ᅬ -48 -47 -46 ᅭ -45 ᅮ -44 ᅯ -43 ᅰ -42 ᅱ -41 ᅲ -40 -39 -38 ᅳ -37 ᅴ -36 ᅵ -35 -34 -33 -32 ¢ -31 £ -30 ¬ -29  ̄ -28 ¦ -27 ¥ -26 ₩ -25 -24 │ -23 ← -22 ↑ -21 → -20 ↓ -19 ■ -18 ○ -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4  -3 � -2 -1 � 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ? 64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w 120 x 121 y 122 z 123 { 124 | 125 } 126 ~