Java equivalent of this 'C' code ?
From: sriram (sriram_kosuri_at_yahoo.com)
Date: 05/31/04
- Next message: Michael Borgwardt: "Re: Running a Java app from command line"
- Previous message: Michael Borgwardt: "Re: Size of primitive types?"
- Next in thread: Chris Smith: "Re: Java equivalent of this 'C' code ?"
- Reply: Chris Smith: "Re: Java equivalent of this 'C' code ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 May 2004 04:36:57 -0700
Hi ,
I am new to Java. Please let me know the java equivalent of below C code.
u_char buf[6];
struct sockaddr_in sockaddr;
sockaddr.sin_family = AF_INET;
sockaddr.sin_addr.s_addr = inet_addr("132.1.1.1");
sockaddr.sin_port = htons(1234);
memcpy( &buf[0], &(sockaddr.sin_addr.s_addr),4);
memcpy( &buf[4], &(sockaddr.sin_port),2);
thanks
-sri
- Next message: Michael Borgwardt: "Re: Running a Java app from command line"
- Previous message: Michael Borgwardt: "Re: Size of primitive types?"
- Next in thread: Chris Smith: "Re: Java equivalent of this 'C' code ?"
- Reply: Chris Smith: "Re: Java equivalent of this 'C' code ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]