Topic: int[]与byte[]转换?

  Print this page

1.int[]与byte[]转换? Copy to clipboard
Posted by: flyingdd
Posted on: 2004-12-14 22:20

如何将int类型数组转换为byte类型数组?

2.Re:int[]与byte[]转换? [Re: flyingdd] Copy to clipboard
Posted by: riceboy0309
Posted on: 2004-12-15 15:27

int级别比byte高,当高转低时,不用强制转换?
而低转高时,需要强制转,int object =(int) b

class Rb
{
Public static void main( String args[])
{
byte b=12;
int i,x
i= (int) b;
b=i;
System .out .println("i="+i"""b="+b)
}
}

3.Re:int[]与byte[]转换? [Re: riceboy0309] Copy to clipboard
Posted by: prettyxx
Posted on: 2004-12-15 16:57

riceboy0309 wrote:
int级别比byte高,当高转低时,不用强制转换?
而低转高时,需要强制转,int object =(int) b

class Rb
{
Public static void main( String args[])
{
byte b=12;
int i,x
i= (int) b;
b=i;
System .out .println("i="+i"""b="+b)
}
}

楼主问的是数组的转换

4.Re:int[]与byte[]转换? [Re: prettyxx] Copy to clipboard
Posted by: flyingdd
Posted on: 2004-12-15 19:15

是啊,我用一个循环语句进行转换,应该有更好的办法吧?


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923