Como converter uma matriz de bytes em uma matriz Int
Eu estou lendo um arquivo usando:
int len = (int)(new File(args[0]).length());
FileInputStream fis =
new FileInputStream(args[0]);
byte buf[] = new byte[len];
fis.read(buf);
Como eu acheiAqui. É possível converterbyte array buf
para umInt Array
? Está convertendo oByte Array
paraInt Array
vai ter muito mais espaço?
Edit: meu arquivo contém milhões de ints como,
100000000 200000000 ..... (escrito usando arquivo normal wirte). Eu li para buffer de byte. Agora quero envolvê-lo no array IntBuffer. Como fazer isso ? Eu não quero converter cada byte para int.