复制 解析/编译

public static void main(String[] args) throws IOException {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("javase2\\a.txt"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:\\hello\\a.txt"));
byte[] by = new byte[1024];
int leng;
while ((leng = bis.read(by)) != -1) {
bos.write(by,0,leng);
}
bis.close();
bos.close();
}


public static void main(String[] args) throws UnsupportedEncodingException {
String s="老溜";
byte[] b=s.getBytes("utf-8");
byte[] s1={-24, -128, -127, -26, -70, -100};
String st=new String(s1);
System.out.println(st);
System.out.println(Arrays.toString(b));
System.out.println(b.length);
}
posted @ 2022-05-27 18:26  雾开见月  阅读(34)  评论(0)    收藏  举报