> Thanks Moiristo for your reply....but i don't understand well what's
> the problem.
> Can you help me explaing it and giving me a solution,if you know it?
> Thanks very much..
In rules 109, 119 and 129, you include a bytearray (the result of
getBytes()) to your temp Vector. An index of a Vector is not a start
position, it refers to an object, which can be a whole array. Therefore,
instead of adding the bytearray from String.getBytes(), you need to add
every byte in the resulting bytearray separately to the Vector. This can
be done by using the function Vector.addAll(<collection>). And AFAIK,
you don't have to use the addElement method for adding a byte, you can
just use the method Vector.add(<object>). Furthermore, I see no real
benefit in giving the Vector an inital capacity; a Vector grows
automatically.
gbattine - 21 Jun 2006 15:57 GMT
Thanks!!!
I'm understanding.......
but i'm not expert in java,can you help me?
If i've understood i've to modify
temp.addElement(intest[i].getBytes());
into
byte[] bytesnew=intest[i].getBytes();
temp.addAll(bytes2);
but the addAll function return a boolean?
How can i do in this specific example?
Can you help me with code?
Thanks........
gbattine - 21 Jun 2006 16:00 GMT
There is an error....i want say
temp.addElement(intest[i].getBytes());
into
byte[] bytesnew=intest[i].getBytes();
temp.addAll(bytesnew);
And for
temp.addElement(g.getBytes());
and
tempByte1 = Double.toString(val[e]).getBytes();
can you help me?
I'm stopped and i need to go on..............thanks too much
gbattine - 21 Jun 2006 19:12 GMT
I try and try but nothing.........can someone help me?
Moiristo - 21 Jun 2006 19:31 GMT
> There is an error....i want say
>
[quoted text clipped - 13 lines]
> can you help me?
> I'm stopped and i need to go on..............thanks too much
I'm sorry, but addAll needs a Collection, you cannot add an array. It's
better to create a for loop like this:
foreach(byte b : bytesnew) temp.add(new Byte(b));
gbattine - 22 Jun 2006 09:07 GMT
Thanks Moiristo...
i've solved my exception but i'm not sure the conversion file to array
of byte works fine.
I need to develop inverse function, i've the array of byte and i want
to rebuild the original format.
How can i do?
I know each string can be coded into more byte like the double...i only
know that whitespace(in byte 32) separates different values and ;(in
byte:59) separate different rows.
I think for the first load the array of double into a string,what's the
code?
public String(byte[] bytes)?
Can you help me with initial code to separate different rows basing on
;(59)?
Thanks very much for your availability.......