Add a writer1.available method.

This commit is contained in:
Nigel Tao committed 2017-10-07 16:15:17 +11:00
1 parent ac405d485b
commit c3ae0534df
6 files changed
+32 -8

No files matched your search

+5 -2
View File
@@ -204,8 +204,11 @@ pri func decoder.decode_uncompressed?(dst writer1, src reader1)() {
return error "internal error: inconsistent Huffman decoder state"
}
length -= n
// TODO: distinguish between reads and writes.
return suspension "short read"
if in.dst.available() == 0 {
return suspension "short write"
} else {
return suspension "short read"
}
}
}