import java.io.*;
class Main{
	public static void main(String[] args) throws IOException, ClassNotFoundException{
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(bos);
		Object o = new int[]{10};
		oos.writeObject(o);
		oos.writeObject(o);
		{
			ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
			ObjectInputStream ois = new ObjectInputStream(bis);
			int[] o1 = (int[])ois.readObject();
			int[] o2 = (int[])ois.readObject();
			o1[0] += 5;
			System.out.println((o1==o2)+":"+o1[0]+" "+o2[0]);
		}
		{
			ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
			ObjectInputStream ois = new ObjectInputStream(bis);
			Object o1 = ois.readUnshared();
			System.out.println("2回目のreadUnshared");
			Object o2 = ois.readUnshared();
		}
	}
}