IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Number bytes read from TInputStream

  • 1.  Number bytes read from TInputStream

    Posted Wed March 24, 2004 01:03 PM

    Hi

    When reading from a TInputStream I was surprised to see how few bytes that were delivered by a read operation (see code below).

    Although a buffer of 100000 chars is provided, the read operation returns only something like 1-3 kB.

    How come?
    Could this behaviour be affected?


    Cheers,

    Hokan

    // TStreamAccessor sAccessor;
    char cbuf = new char[100000];
    TInputStream resultStream = sAccessor.query(TQuery.newInstance(“/MyDoc”));
    InputStreamReader isr = new InputStreamReader(resultStream, “UTF8”);
    int nbChars = isr.read(cbuf);


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 2.  RE: Number bytes read from TInputStream

    Posted Wed March 24, 2004 01:33 PM

    I suspect that this is related to the response being of indeterminate length. This means that it is sent as a chunked transfer. Typically these chunks are 8K or less.

    I think that you should continue reading until end of stream.


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods