1. /*
  2. * @(#)UnknownServiceContext.java 1.12 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.core;
  8. import org.omg.CORBA.SystemException;
  9. import org.omg.CORBA_2_3.portable.InputStream;
  10. import org.omg.CORBA_2_3.portable.OutputStream;
  11. import com.sun.corba.se.internal.core.ServiceContext ;
  12. public class UnknownServiceContext extends ServiceContext {
  13. public UnknownServiceContext( int id, byte[] data )
  14. {
  15. this.id = id ;
  16. this.data = data ;
  17. }
  18. public UnknownServiceContext( int id, InputStream is )
  19. {
  20. this.id = id ;
  21. int len = is.read_long();
  22. data = new byte[len];
  23. is.read_octet_array(data,0,len);
  24. }
  25. public int getId() { return id ; }
  26. public void writeData( OutputStream os ) throws SystemException
  27. {
  28. }
  29. public void write( OutputStream os , GIOPVersion gv)
  30. throws SystemException
  31. {
  32. os.write_long( id ) ;
  33. os.write_long( data.length ) ;
  34. os.write_octet_array( data, 0, data.length ) ;
  35. }
  36. public byte[] getData()
  37. {
  38. return data ;
  39. }
  40. private int id = -1 ;
  41. private byte[] data = null ;
  42. }