🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.programmer
Article #588

Re: InetAddress - no solution

#588
From: Martin Ry��nek
Date: Thu, 17 Sep 1998 00:00
27 lines
1464 bytes
>I have just byte[] array of 4 bytes and need to create regular InetAddress
>class.
>
>I don't know host's name and so. I only know host's IP address. I can't
>create regular
>InetAddress class, because I have to pass the name of the host to
>constructor.
>
>InetAddress inet = new InetAddress(null, array);
>is NOT solution, because InetAddress is willing to create String with null
>pointer.
>
>If I pass "" string, I can not receive host name based on IP.
>
>How can I receive host name based on IP, if I have just IP as 4 byte array
?


The only solution is:

convert your 4 byte array to string in dot convention first, then pass
to InetAddress as string. That works fine.

Sounds good ?!?!?!?! is not it.

Martin
Technical Details
Message-ID: <360108ae.0@news.cvut.cz>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <360105eb.0@news.cvut.cz>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb99b,e06616101d23416f
X-Google-Attributes: gidfb99b,public
X-Google-Thread: 10a146,e06616101d23416f
X-Google-Attributes: gid10a146,public
X-Google-Thread: f5e83,e06616101d23416f
X-Google-Attributes: gidf5e83,public
From: "Martin Ry��nek" <rysanek@telecom.cz>
Subject: Re: InetAddress - no solution
Date: 1998/09/17
Message-ID: <360108ae.0@news.cvut.cz>
X-Deja-AN: 392036413
X-NNTP-Posting-Host: pc7.telecom.cz
References: <360105eb.0@news.cvut.cz>
Organization: Ceske Vysoke Uceni Technicke, Praha
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: comp.lang.java.programmer,comp.lang.java.softwaretools,cz.comp.lang.java