TMC-IOENC: Decoder implementation clean-up.

This commit is contained in:
Harald Kuhr
2013-09-13 16:25:36 +02:00
parent cd6e9ebbf5
commit d1f00ce817
9 changed files with 54 additions and 56 deletions

View File

@@ -76,17 +76,17 @@ final class InflateDecoder implements Decoder {
buffer = new byte[1024];
}
public int decode(final InputStream pStream, final ByteBuffer pBuffer) throws IOException {
public int decode(final InputStream stream, final ByteBuffer buffer) throws IOException {
try {
int decoded;
while ((decoded = inflater.inflate(pBuffer.array(), pBuffer.arrayOffset(), pBuffer.capacity())) == 0) {
while ((decoded = inflater.inflate(buffer.array(), buffer.arrayOffset(), buffer.capacity())) == 0) {
if (inflater.finished() || inflater.needsDictionary()) {
return 0;
}
if (inflater.needsInput()) {
fill(pStream);
fill(stream);
}
}