1. /*
  2. * @(#)UnknownServiceContext.java 1.15 04/06/21
  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.spi.servicecontext;
  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.spi.ior.iiop.GIOPVersion;
  12. import com.sun.corba.se.spi.servicecontext.ServiceContext ;
  13. public class UnknownServiceContext extends ServiceContext {
  14. public UnknownServiceContext( int id, byte[] data )
  15. {
  16. this.id = id ;
  17. this.data = data ;
  18. }
  19. public UnknownServiceContext( int id, InputStream is )
  20. {
  21. this.id = id ;
  22. int len = is.read_long();
  23. data = new byte[len];
  24. is.read_octet_array(data,0,len);
  25. }
  26. public int getId() { return id ; }
  27. public void writeData( OutputStream os ) throws SystemException
  28. {
  29. }
  30. public void write( OutputStream os , GIOPVersion gv)
  31. throws SystemException
  32. {
  33. os.write_long( id ) ;
  34. os.write_long( data.length ) ;
  35. os.write_octet_array( data, 0, data.length ) ;
  36. }
  37. public byte[] getData()
  38. {
  39. return data ;
  40. }
  41. private int id = -1 ;
  42. private byte[] data = null ;
  43. }