Hi All,
I have a byte array of size 4 whuch should be converted to its float value.
I am able to this kind of conversion (byte array) to integer primitive but
its difficult to apply the samme..
Thanx in adv,
madhu
Printable View
Hi All,
I have a byte array of size 4 whuch should be converted to its float value.
I am able to this kind of conversion (byte array) to integer primitive but
its difficult to apply the samme..
Thanx in adv,
madhu
A better solution to this problem would be to create a float value in the
first place instead of creating a byte array and then trying to convert it.
However, here's an answer to your question:
DataInputStream dis = new DataInputStream(new
ByteArrayInputStream(yourByteArray));
float f = dis.readFloat();
But as I said, it would be better to use a DataInputStream and readFloat()
to create the value in the first place. And the same is true for integers.
PC2
"madhusudhan" <madhu_sri@indya.com> wrote in message
news:3b0cd07a$1@news.devx.com...
>
> Hi All,
> I have a byte array of size 4 whuch should be converted to its float
value.
> I am able to this kind of conversion (byte array) to integer primitive
but
>
> its difficult to apply the samme..
> Thanx in adv,
> madhu
>
>
Hi
How does the decimal portion is stored in the byte array of size 4
"madhusudhan" <madhu_sri@indya.com> wrote:
>
>Hi All,
> I have a byte array of size 4 whuch should be converted to its float value.
> I am able to this kind of conversion (byte array) to integer primitive
but
>
>its difficult to apply the samme..
>Thanx in adv,
>madhu
>
>