1. /*
  2. * @(#)IIOPOutputStream_1_3.java 1.6 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.orbutil;
  8. import java.io.*;
  9. /**
  10. * Implements legacy behavior from before Ladybird to maintain
  11. * backwards compatibility.
  12. */
  13. public class IIOPOutputStream_1_3 extends com.sun.corba.se.impl.io.IIOPOutputStream
  14. {
  15. // We can't assume that the superclass's putFields
  16. // member will be non-private. We must allow
  17. // the RI to run on JDK 1.3.1 FCS as well as
  18. // the JDK 1.3.1_01 patch.
  19. private ObjectOutputStream.PutField putFields_1_3;
  20. // The newer version in the io package correctly writes a wstring instead.
  21. // This concerns bug 4379597.
  22. protected void internalWriteUTF(org.omg.CORBA.portable.OutputStream stream,
  23. String data)
  24. {
  25. stream.write_string(data);
  26. }
  27. public IIOPOutputStream_1_3()
  28. throws java.io.IOException {
  29. super();
  30. }
  31. /**
  32. * Before JDK 1.3.1_01, the PutField/GetField implementation
  33. * actually sent a Hashtable.
  34. */
  35. public ObjectOutputStream.PutField putFields()
  36. throws IOException {
  37. putFields_1_3 = new LegacyHookPutFields();
  38. return putFields_1_3;
  39. }
  40. public void writeFields()
  41. throws IOException {
  42. putFields_1_3.write(this);
  43. }
  44. }