equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2014, 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. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
33 |
33 |
34 import java.io.IOException; |
34 import java.io.IOException; |
35 import java.io.OutputStream; |
35 import java.io.OutputStream; |
36 import java.io.ObjectOutputStream; |
36 import java.io.ObjectOutputStream; |
37 import java.io.ObjectOutput; |
37 import java.io.ObjectOutput; |
38 import java.util.Hashtable; |
38 import java.util.Map; |
|
39 import java.util.HashMap; |
39 |
40 |
40 import org.omg.CORBA.INTERNAL; |
41 import org.omg.CORBA.INTERNAL; |
41 |
42 |
42 public abstract class OutputStreamHook extends ObjectOutputStream |
43 public abstract class OutputStreamHook extends ObjectOutputStream |
43 { |
44 { |
47 * Since ObjectOutputStream.PutField methods specify no exceptions, |
48 * Since ObjectOutputStream.PutField methods specify no exceptions, |
48 * we are not checking for null parameters on put methods. |
49 * we are not checking for null parameters on put methods. |
49 */ |
50 */ |
50 private class HookPutFields extends ObjectOutputStream.PutField |
51 private class HookPutFields extends ObjectOutputStream.PutField |
51 { |
52 { |
52 private Hashtable fields = new Hashtable(); |
53 private Map<String,Object> fields = new HashMap<>(); |
53 |
54 |
54 /** |
55 /** |
55 * Put the value of the named boolean field into the persistent field. |
56 * Put the value of the named boolean field into the persistent field. |
56 */ |
57 */ |
57 public void put(String name, boolean value){ |
58 public void put(String name, boolean value){ |
138 abstract void writeField(ObjectStreamField field, Object value) throws IOException; |
139 abstract void writeField(ObjectStreamField field, Object value) throws IOException; |
139 |
140 |
140 public OutputStreamHook() |
141 public OutputStreamHook() |
141 throws java.io.IOException { |
142 throws java.io.IOException { |
142 super(); |
143 super(); |
143 |
|
144 } |
144 } |
145 |
145 |
146 public void defaultWriteObject() throws IOException { |
146 public void defaultWriteObject() throws IOException { |
147 |
147 |
148 writeObjectState.defaultWriteObject(this); |
148 writeObjectState.defaultWriteObject(this); |