well, thanx for pointing it out,
but my question can I read bytes to arraylist, and later or
if I wanto cast them to char and wrap as objects?
and how do I cast & wrap in that case? shoud one take 2 byts at the time?
for char in this case?
>> but if not? I mean if file was created some other way,
>> can one read byts as object and cat it to char.
[quoted text clipped - 10 lines]
>
> - Oliver

Signature
Thanx in advance
________________________
Oliver Wong - 27 Jan 2006 21:52 GMT
> well, thanx for pointing it out,
> but my question can I read bytes to arraylist, and later or
> if I wanto cast them to char and wrap as objects?
> and how do I cast & wrap in that case? shoud one take 2 byts at the time?
> for char in this case?
I'm not sure I understand your questions, so I'm going to make some
statements, and hopefully these statements will contain the information you
want.
You can read the bytes one at a time, and put them into an ArrayList of
Byte objects, or you could read the bytes into an array of bytes (e.g.
byte[]).
Given a Byte object, you can get its corresponding byte value. Given a
byte, you can create a corresponding Byte object.
Given a Character object, you can get its corresponding char value.
Given a char, you can create a corresponding Character object.
To convert between bytes and chars (or Bytes and Characters), you need
to use an encoding, e.g. UTF-8, ASCII, etc. Not all encodings map 2 bytes to
1 character.
- Oliver