DatagramPacket.h

Go to the documentation of this file.
00001 #ifndef JAVA_NET_DATAGRAMPACKET_H
00002 #define JAVA_NET_DATAGRAMPACKET_H 1
00003 
00004 #ifndef JAVA_LANG_SYNC_H
00005 #include <java_lang/Sync.h>
00006 #endif /* JAVA_LANG_SYNC_H */
00007 #ifndef JAVA_NET_INETSOCKETADDRESS_H
00008 #include <java_net/InetSocketAddress.h>
00009 #endif /* JAVA_NET_INETSOCKETADDRESS_H */
00010 #ifndef JAVA_NET_SPEC
00011 #include <java_net/Spec.h>
00012 #endif /* JAVA_NET_SPEC */
00013 
00014 namespace java {
00015   namespace net {
00016 
00033     class JAVA_NET_SPEC DatagramPacket : virtual public Object, virtual public Sync {
00034 
00035     public:
00036 
00053       DatagramPacket(const Ref<Array<jbyte> >& buf = 0, jint offset = 0, jint length = -1, const Ref<InetAddress>& address = 0, jint port = -1);
00054 
00071       DatagramPacket(const Ref<Array<jbyte> >& buf, jint offset = 0, jint length = -1, const Ref<SocketAddress>& address = 0);
00072 
00082       Ref<InetAddress> getAddress() const;
00083 
00092       jint getPort() const;
00093 
00102       Ref<Array<jbyte> > getData() const;
00103 
00113       jint getOffset() const;
00114 
00123       jint getLength() const;
00124 
00144       void setData(const Ref<Array<jbyte> >& buf, jint offset = 0, jint length = -1);
00145 
00153       void setAddress(const Ref<InetAddress>& iaddr);
00154 
00162       void setPort(jint iport);
00163 
00175       void setSocketAddress(const Ref<SocketAddress>& address);
00176 
00185       Ref<SocketAddress> getSocketAddress() const;
00186 
00205       void setLength(jint length);
00206 
00207     protected:
00208 
00209       Ref<Array<jbyte> > buf;
00210       jint offset;
00211       jint length;
00212       Ref<InetAddress> address;
00213       jint port;
00214 
00215     private:
00216 
00217       REGISTER_MEMBERS;
00218 
00219     };
00220 
00221   } // namespace net
00222 } // namespace java
00223 
00224 #endif /* JAVA_NET_DATAGRAMPACKET_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3