Problems reading from Input Stream
I am trying to read an input stream obtained by an http connection into an array, but I am not able to read it completely.
The methods I have used are:
--- int numBytes = disAux.read( arrayTotal );
--- disAux.readFully( arrayTotal );
--- disAux.read( arrayTotal, 0, dim);
--- // Reading bytes:
while( k<dim )
arrayTotal[k] = leerByte( disAux );
private byte leerByte( DataInputStream disAux )
byte b = 0;
Integer numObjAux = new Integer( disAux.read() );
b = numObjAux.byteValue();
numObjAux = null;
catch( Exception e )
throw e; // lanza excepcion
In this function I obtain an IO Exception, and the message
" 'chunk' not CALF terminated "
Please, could anyone tell me something about this?
Thanks in advance.
Partial solution and new problem
I have added at the end of the last image of the stream an integer, to indicate its final and now aplication is able to read up to 12kb without the exception mentioned, but now I have another problem that I am going to write in another thread....