right



Rob Nugent wrote:

It doesn't seem to be necessary to use the cast in the last of these.

E.G. the following works:

        byte b = -10;
        int i = b & 0xff;
        System.out.println(i);

I'm guessing because the bit-operations work on and return ints.

Rob


Auguste Genovesio wrote:


int i
byte b


b = (byte) i; // convert int to byte i = (int) b; // convert byte to int , b=-10 -> int = -10 i = (int) (b & 0xff) // unsigne b and convert it to int , b=-10 -> int = 245


ok ?




hterrolle wrote:

I think i find my way using the ByteArrayOutputStream.class. it look
fine
working with byte

thanks
-----Message d'origine-----
De : Auguste Genovesio <[EMAIL PROTECTED]>
Ŕ : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : jeudi 11 septembre 2003 12:24
Objet : Re: [JAVA3D] Working whit byte problem




Hi,

The answer to your problem is probably the native static method
System.arraycopy()




hterrolle wrote:




Hi,

I know it is not the best place to ask this. But i do not know any
other were people answer.
I got a problem working with byte type in JAVA. i am use to C.

So i like to crete a struc
           byte toto
                   byte[]  size    = new byte[10];
                   byte[]  data    = null;
and i would like to copy this structure into another byte[]. but i
find out that we cannot concatenate byte.
and i did not find any method that allow me to copy into bytte[]. I do
not want to use String to byte because of the problem of decode and
coding. i findout that there is some trouble with it (back slash into
blank).

Does some one could tell me how to do this:

           copy the size into the byte[] then adding the data to the
same byte[].
           how to extract the 10 first byte from the byte[]

i really do not know how to solve this problem in JAVA.

One small example would be so nice

Thanks
       Herve



===========================================================================




To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body of the message "signoff JAVA3D-INTEREST". For general help, send
email to [EMAIL PROTECTED] and include in the body of the message
"help".



-- A. Genovesio Quantitative Image Analysis Group Institut Pasteur 25, rue du Docteur Roux 75724 Paris Cedex 15

===========================================================================


To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".




===========================================================================



To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".






--
A. Genovesio
Quantitative Image Analysis Group
Institut Pasteur
25, rue du Docteur Roux
75724 Paris Cedex 15

===========================================================================

To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
of the message "signoff JAVA3D-INTEREST".  For general help, send
email to
[EMAIL PROTECTED] and include in the body of the message "help".


--


Rob Nugent Sun Microsystems, Southampton, UK

[EMAIL PROTECTED]

Tel: +44 (0) 1489 585503
Fax: +44 (0) 1489 881363

===========================================================================

To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA3D-INTEREST".  For general help, send
email to
[EMAIL PROTECTED] and include in the body of the message "help".




--
A. Genovesio
Quantitative Image Analysis Group
Institut Pasteur
25, rue du Docteur Roux
75724 Paris Cedex 15

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to