src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java

changeset 940
303fd9eb7e21
parent 754
20e2e121586b
child 1022
6081f57a0021
equal deleted inserted replaced
937:3b19c17ea11c 940:303fd9eb7e21
1 /* 1 /*
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2015, 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
30 */ 30 */
31 31
32 package com.sun.corba.se.impl.io; 32 package com.sun.corba.se.impl.io;
33 33
34 import java.io.IOException; 34 import java.io.IOException;
35 import java.io.NotActiveException;
35 import java.io.OutputStream; 36 import java.io.OutputStream;
36 import java.io.ObjectOutputStream; 37 import java.io.ObjectOutputStream;
37 import java.io.ObjectOutput; 38 import java.io.ObjectOutput;
38 import java.util.Map; 39 import java.util.Map;
39 import java.util.HashMap; 40 import java.util.HashMap;
152 153
153 public abstract void defaultWriteObjectDelegate(); 154 public abstract void defaultWriteObjectDelegate();
154 155
155 public ObjectOutputStream.PutField putFields() 156 public ObjectOutputStream.PutField putFields()
156 throws IOException { 157 throws IOException {
157 putFields = new HookPutFields(); 158 if (putFields == null) {
159 putFields = new HookPutFields();
160 }
158 return putFields; 161 return putFields;
159 } 162 }
160 163
161 // Stream format version, saved/restored during recursive calls 164 // Stream format version, saved/restored during recursive calls
162 protected byte streamFormatVersion = 1; 165 protected byte streamFormatVersion = 1;
173 // See java.io.ObjectOutputStream.PutFields 176 // See java.io.ObjectOutputStream.PutFields
174 public void writeFields() 177 public void writeFields()
175 throws IOException { 178 throws IOException {
176 179
177 writeObjectState.defaultWriteObject(this); 180 writeObjectState.defaultWriteObject(this);
178 181 if (putFields != null) {
179 putFields.write(this); 182 putFields.write(this);
183 } else {
184 throw new NotActiveException("no current PutField object");
185 }
180 } 186 }
181 187
182 abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream(); 188 abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream();
183 189
184 protected abstract void beginOptionalCustomData(); 190 protected abstract void beginOptionalCustomData();

mercurial