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 );
k++;
}

private byte leerByte( DataInputStream disAux )
throws Exception
{
byte b = 0;

try
{
Integer numObjAux = new Integer( disAux.read() );
b = numObjAux.byteValue();
numObjAux = null;
}
catch( Exception e )
{
System.out.println("leerByte: ERROR");
this.actualizarDisplayConexion("leerByte: ERROR:
e.getClass():"+e.getClass()+"
e.getMessage():"+e.getMessage());
throw e; // lanza excepcion
}
return b;
}


In this function I obtain an IO Exception, and the message
associated is:

" 'chunk' not CALF terminated "


Please, could anyone tell me something about this?

Thanks in advance.