test/jdk/java/io/Serializable/classDescHooks/CNFException.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
equal deleted inserted replaced
58564:218a1a642c6f 58565:baa5969ecf34
     1 /*
     1 /*
     2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    45 
    45 
    46 public class CNFException {
    46 public class CNFException {
    47     public static void main(String[] args) throws Exception {
    47     public static void main(String[] args) throws Exception {
    48         ByteArrayOutputStream bout = new ByteArrayOutputStream();
    48         ByteArrayOutputStream bout = new ByteArrayOutputStream();
    49         ObjectOutputStream oout = new ObjectOutputStream(bout);
    49         ObjectOutputStream oout = new ObjectOutputStream(bout);
    50         oout.writeObject(new Integer(5));
    50         oout.writeObject(5);
    51         oout.close();
    51         oout.close();
    52         ObjectInputStream oin =
    52         ObjectInputStream oin =
    53             new CNFInputStream(new ByteArrayInputStream(bout.toByteArray()));
    53             new CNFInputStream(new ByteArrayInputStream(bout.toByteArray()));
    54         try {
    54         try {
    55             oin.readObject();
    55             oin.readObject();