473,382 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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.SocketAddress and
java.nio.ByteBuffer ?

Thanks.

Nov 17 '05 #1
2 7686
Yaron,

The .NET equivalent for SocketAddress would be EndPoint. For an IP
address (in Java, it is InetSocketAddress), 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.com

"yaron" <ya***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
Hi,

for porting java to c# i need to know:
What is the C#.NET equivalent for java.net.SocketAddress and
java.nio.ByteBuffer ?

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 InetSocketAddress), 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.com

"yaron" <ya***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
Hi,

for porting java to c# i need to know:
What is the C#.NET equivalent for java.net.SocketAddress and
java.nio.ByteBuffer ?

Thanks.


Nov 17 '05 #3

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

Similar topics

54
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...
8
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 ;...
4
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...
4
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...
10
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
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...
7
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...
3
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...
16
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

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.