muchísimas gracias he probado establecer max memoria pero al ser para un dispositivo android no me interesa mucho.
Te comento un poco, a ver si por fin me deshago de este pequeño marrón.
¿de la clase InputStream puedo leer byte a byte?Imagino que sí, aunque no me queda muy claro.
esta sería la mas simple.
do
{
i=inputStream.read();
}while(i != -1);
y con esta
int read(byte[] b, int off, int len)
b, buffer sobre el que dejaremos los bytes resultado de la lectura.
off, indica la posición del buffer en la cual se almacenarán los bytes leídos.
len, número de bytes a leer.
¿Siempre estoy leyendo los mismo bytes? Imagino que no cuando llegue al fin me devolverá -1
haciedno algo rápido y sin pensar mucho, abriendo 3 ficheros, de distintas longitudes.
int len_file1 = input1.available();
int len_file2 = input2.available();
int len_file3 = input3.available();
short byte_file1 = 0;
short byte_file2 = 0;
short byte_file3 = 0;
int k = 0;
int suma = 0;
do{
k = 0;
suma = 0;
if(byte_file1 = input1.readShort() >-1){
k++;
suma += fin
}
if(byte_file2 = input2.readShort() >-1)
{
k++;
suma += byte_file2; //antes de sumarlas tendría que ordenarlo a little indian
}
if(byte_file3 = input3.readShort() >-1)
{
k++;
suma += byte_file3;
}
//aquí para almacenarlo que seria lo mejor guardar fichero oOutputStreme?
// sin gastar muca memoria
}while(fin_file1 > -1 && fin_file2 > -1 && fin_file3 > -1);