标签:nbsp 实现 bsp int 存储 fileinput 中文 影响 blog
package itcast_02; import java.util.Arrays; /* * 在计算机中如何识别将连个字节转换为中文的呢? * 在计算机中中文的存储为两个字节 : * 第一个字节 : 一定为负数 * 第二个字节 : 可能为负数 (常见), 也可能为正数 ,没有影响 * * */ public class FileInputStreamDemo2 { public static void main(String[] args) { String s = "abcde"; //[97, 98, 99, 100, 101] byte [] bye = s.getBytes(); System.out.println(Arrays.toString(bye)); System.out.println("---------------"); String s1 = "我爱我爱刁雪健"; //[-50, -46, -80, -82, -50, -46, -80, -82, -75, -13, -47, -87, -67, -95] byte [] by = s1.getBytes(); System.out.println(Arrays.toString(by)); } }
用FileInputStream读取数据,计算机如何实现将两个字节拼接成中文的?
标签:nbsp 实现 bsp int 存储 fileinput 中文 影响 blog
原文地址:http://www.cnblogs.com/reed-wafw/p/6159930.html