Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003350 [Resin] minor always 02-22-09 12:51 07-25-11 15:21
Reporter karlgold View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.6
Summary 0003350: com.caucho.vfs.BufferedReaderAdapter ignores mark() and reset()
Description I tried something like the following on a request with some body content:

    char[] buffer = new char[READ_AHEAD_LIMIT];
    BufferedReader reader = request.getReader();
    boolean ready = reader.ready();
    if (ready) {
      reader.mark(READ_AHEAD_LIMIT);
      reader.read(buffer);
      ready = reader.ready(); // result == FALSE
      reader.reset();
      boolean notReady = reader.ready(); // result should be TRUE, but is FALSE
    }

Looking at BufferedReaderAdapter, read() and ready() are delegated to the underlying ReadStream, but mark() and reset() are not. Calling them has not effect on the ReadStream.

Workaround is to wrap the reader obtained from the request in yet another BufferedReader, but it would be better if request.getReader() returned a fully functional BufferedReader.
Additional Information
Attached Files

- Relationships

- Notes
(0005398)
ferg
07-25-11 15:21

server/1m01
 

- Issue History
Date Modified Username Field Change
02-22-09 12:51 karlgold New Issue
02-22-09 12:52 karlgold Issue Monitored: karlgold
07-25-11 15:21 ferg Note Added: 0005398
07-25-11 15:21 ferg Assigned To  => ferg
07-25-11 15:21 ferg Status new => closed
07-25-11 15:21 ferg Resolution open => fixed
07-25-11 15:21 ferg Fixed in Version  => 4.0.21


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker