1 /*
2 * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
500 handles.markDependency(outerHandle, passHandle);
501 ClassNotFoundException ex = handles.lookupException(passHandle);
502 if (ex != null) {
503 throw ex;
504 }
505 if (depth == 0) {
506 vlist.doCallbacks();
507 freeze();
508 }
509 return obj;
510 } finally {
511 passHandle = outerHandle;
512 if (closed && depth == 0) {
513 clear();
514 }
515 }
516 }
517
518 /**
519 * This method is called by trusted subclasses of ObjectInputStream that
520 + constructed ObjectInputStream using the protected no-arg constructor.
521 * The subclass is expected to provide an override method with the modifier
522 * "final".
523 *
524 * @return the Object read from the stream.
525 * @throws ClassNotFoundException Class definition of a serialized object
526 * cannot be found.
527 * @throws OptionalDataException Primitive data was found in the stream
528 * instead of objects.
529 * @throws IOException if I/O errors occurred while reading from the
530 * underlying stream
531 * @see #ObjectInputStream()
532 * @see #readObject()
533 * @since 1.2
534 */
535 protected Object readObjectOverride()
536 throws IOException, ClassNotFoundException
537 {
538 return null;
539 }
540
|
1 /*
2 * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
500 handles.markDependency(outerHandle, passHandle);
501 ClassNotFoundException ex = handles.lookupException(passHandle);
502 if (ex != null) {
503 throw ex;
504 }
505 if (depth == 0) {
506 vlist.doCallbacks();
507 freeze();
508 }
509 return obj;
510 } finally {
511 passHandle = outerHandle;
512 if (closed && depth == 0) {
513 clear();
514 }
515 }
516 }
517
518 /**
519 * This method is called by trusted subclasses of ObjectInputStream that
520 * constructed ObjectInputStream using the protected no-arg constructor.
521 * The subclass is expected to provide an override method with the modifier
522 * "final".
523 *
524 * @return the Object read from the stream.
525 * @throws ClassNotFoundException Class definition of a serialized object
526 * cannot be found.
527 * @throws OptionalDataException Primitive data was found in the stream
528 * instead of objects.
529 * @throws IOException if I/O errors occurred while reading from the
530 * underlying stream
531 * @see #ObjectInputStream()
532 * @see #readObject()
533 * @since 1.2
534 */
535 protected Object readObjectOverride()
536 throws IOException, ClassNotFoundException
537 {
538 return null;
539 }
540
|