1. /*
  2. * @(#)IIOPAddressImpl.java 1.3 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. //Source file: J:/ws/serveractivation/src/share/classes/com.sun.corba.se.internal.ior/IIOPAddress.java
  8. package com.sun.corba.se.internal.ior;
  9. import org.omg.CORBA.BAD_PARAM ;
  10. import org.omg.CORBA_2_3.portable.InputStream ;
  11. import org.omg.CORBA_2_3.portable.OutputStream ;
  12. /**
  13. * @author
  14. */
  15. public final class IIOPAddressImpl extends IIOPAddressBase
  16. {
  17. private String host;
  18. private int port;
  19. public IIOPAddressImpl( String host, int port )
  20. {
  21. if ((port < 0) || (port > 65535))
  22. throw new BAD_PARAM() ;
  23. this.host = host ;
  24. this.port = port ;
  25. }
  26. public IIOPAddressImpl( InputStream is )
  27. {
  28. host = is.read_string() ;
  29. short thePort = is.read_short() ;
  30. port = shortToInt( thePort ) ;
  31. }
  32. public String getHost()
  33. {
  34. return host ;
  35. }
  36. public int getPort()
  37. {
  38. return port ;
  39. }
  40. }