使用ObjectOutputStream写文件时出现乱码,读取也读取不出来是怎么回事?

package serialization;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class WriteObject {

    public static void main(String[] args) {
        System.out.println("我们正在写入Objcet.....");
        
        Person wang = new Person(111,"Wangweida");
        Person yan = new Person(222,"Yanting");
        
        System.out.println(wang);
        System.out.println(yan);
        
    
            try(FileOutputStream fs = new FileOutputStream("person.bin")){
                ObjectOutputStream os = new ObjectOutputStream(fs);
                
                os.writeObject(wang);
                os.writeObject(yan);
                
                os.close();
            } catch (FileNotFoundException e) {
              
                e.printStackTrace();
            } catch (IOException e) {
             
                e.printStackTrace();
            }
    
    }

}

建议看看ObjectOutputStream当中的

writeObject源码