Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1021 (new defect)

Opened 5 months ago

Last modified 2 months ago

BzipInput.read() throws exception instead of returning Eof

Reported by: paulm Assigned to: DRK
Priority: normal Milestone: 0.99.8
Component: IO Version: 0.99.5 Jascha
Keywords: bzip exception eof triage Cc:

Description

Here is a small problem I encountered with BzipInput. Code like the following always throws BzipClosedException, since BzipInput.read() calls kill_bzs() on a last chunk of data (BzipStream.d:250), and on the next call check_valid() throws the exception (BzipStream.d:327). ZlibInput is different - it returns Eof instead of calling check_valid() (ZlibStream.d:139-140).

auto z = new BzipInput(f);
uint len = 0;
auto con = out.conduit;
auto tmp = new byte [con.bufferSize];
try {
    while( len != IConduit.Eof ) {
        len = z.read(tmp);
    }
} catch( BzipClosedException ex) {
    Cout(ex.toString).newline.flush;
}

Change History

04/27/08 05:19:52 changed by larsivi

  • milestone changed from 0.99.6 to 0.99.7.

05/24/08 14:46:12 changed by larsivi

  • keywords changed from bzip exception eof to bzip exception eof triage.

07/10/08 06:54:44 changed by larsivi

  • milestone changed from 0.99.7 to 0.99.8.