Hi,
I'm trying to write a simple reader, but i'm facing
some problems writing the response to the client!!
This reader reads some resource, then write the resource 
content into a socket and then reads the socket InputStream
and write it to the client.

The resource content is well writen into the socket.
I can read the socket inputstream correctly. I'm logging
the result and is ok.

The problem occurs when I try to write the result to
the client. 

A) Does not work

B) Works well, if A section is commented up.


public class SocketReader extends ResourceReader
{


public void generate() throws IOException, ProcessingException
{
 //Write resource content into socket
....
//read socket input stream
 buf_reader = new BufferedReader( new 
InputStreamReader( socket.getInputStream(),"ISO-8859-1" ));

A) -----------------------
String line=null;
while(null!=(line=buf_reader.readLine()))
{
    //result is writed to log ok
    if(getLogger().isDebugEnabled())
        getLogger().debug(new String(line.getBytes());
        
    //Nothing is writed here!!!!
        out.write(line.getBytes());
}

B) ------------------------
  out.write("SOMETEXTEHERE".getBytes());
...

Is this because I'm not setting up the response header?!
I can't predict the response size.

Thanks for any help...
Rui








-- 
Rui Alberto L. GonÃalves <[EMAIL PROTECTED]>
PT InovaÃÃo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to