package com.shrimpking.t4;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/9/22 20:33
*/
//ch16-3
public class EncodingDemo
{
public static void main(String[] args) throws IOException
{
String str = "大家一起来学Java语言";
byte[] b = str.getBytes("GB2312");
OutputStream out = new FileOutputStream(new File("d:\\test\\encoding.txt"));
out.write(b);
out.close();
}
}
EncodingDemo
最新推荐文章于 2024-10-30 18:07:32 发布