473,785 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the C#.NET equivalent for java SocketAddress and ByteBuffe

Hi,

for porting java to c# i need to know:
What is the C#.NET equivalent for java.net.Socket Address and
java.nio.ByteBu ffer ?

Thanks.

Nov 17 '05 #1
2 7716
Yaron,

The .NET equivalent for SocketAddress would be EndPoint. For an IP
address (in Java, it is InetSocketAddre ss), you can use the IPEndPoint
class. In .NET, it is a little different, as you can't use a DNS name (you
can use the static methods on the DNS class to resolve a dns name into an IP
address), just an IP address.

For the ByteBuffer class, there is no direct equivalent. I would
recomment you use a MemoryStream instance (for the backing store), along
with a BinaryReader/BinaryWriter class to read/write primitive data types
to/from the stream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"yaron" <ya***@discussi ons.microsoft.c om> wrote in message
news:D9******** *************** ***********@mic rosoft.com...
Hi,

for porting java to c# i need to know:
What is the C#.NET equivalent for java.net.Socket Address and
java.nio.ByteBu ffer ?

Thanks.

Nov 17 '05 #2
Thanks a lot.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Yaron,

The .NET equivalent for SocketAddress would be EndPoint. For an IP
address (in Java, it is InetSocketAddre ss), you can use the IPEndPoint
class. In .NET, it is a little different, as you can't use a DNS name (you
can use the static methods on the DNS class to resolve a dns name into an IP
address), just an IP address.

For the ByteBuffer class, there is no direct equivalent. I would
recomment you use a MemoryStream instance (for the backing store), along
with a BinaryReader/BinaryWriter class to read/write primitive data types
to/from the stream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"yaron" <ya***@discussi ons.microsoft.c om> wrote in message
news:D9******** *************** ***********@mic rosoft.com...
Hi,

for porting java to c# i need to know:
What is the C#.NET equivalent for java.net.Socket Address and
java.nio.ByteBu ffer ?

Thanks.


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
6577
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO FRICKIN' COOL!!! ***MAN*** that would save me a buttload of work and make my life sooooo much easier!" As opposed to minor differences of this feature here, that feature there. Variations on style are of no interest to me. I'm coming at this from a...
8
4051
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I think about learning VB Net / ASP Net . I am
4
6917
by: Jim H | last post by:
Does .NET have an equivalent to java's JMS messaging. I'm not a java programmer but as I understand it a java application can be setup to pass entire objects between processes. Is there some sort of equivalent in .NET? I have a meeting on Monday to discuss the direction we plan to go with one of our major products. This discussion is going to be dealing mostly with front end applications. I want to argue the .NET point. There are...
4
3640
by: Kunle Odutola | last post by:
I'm trying to understand where the information in the META.INF directory including MANIFEST.MF etc is to be found for .NET assemblies. Also some projects such as Eclipse's OSGi kernel stores additional info in the MANIFEST.MF file. What would be the .NET equivalent where such info can be stored? Kunle --
10
2624
by: vivekian | last post by:
Hi , New to dot net and C# and was wondering what is the equivalent of a java package in dot net ? thanks, vivekian
669
26220
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
7
3721
by: divya | last post by:
What is an equivalent TimeSerial() function of VBscript in the Java Script?? I have two variables hour and minutes. Timeserial(hour,minutes) returns the time hour : minutes. But I want to do similar thing using the javascript .Can anybody help me out with the procedure. Divya.
3
4901
by: Angus | last post by:
Hello I need to port some Java code and am wondering if there is a close equivalent to ByteArrayOutputStream. I have been looking at the STL iostream library but not quite sure what is best to use. Any help would be much appreciated.
16
5116
by: 3rdshiftcoder | last post by:
hi- where would someone find things like lists, sets, map classes like a hash map or tree map. not specifically those but in general is there a book section that deals with it? in java you can use the interface to these without having to know all of the implementation details. is there an interface to a library with these kind of methods in c++? i knew a little c++ from 2 really basic introductory courses. however, each time we...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.