By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.