|
@@ -120,7 +120,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized void setInput(byte[] b, int off, int len) {
|
|
|
|
|
|
+ public void setInput(byte[] b, int off, int len) {
|
|
if (b == null) {
|
|
if (b == null) {
|
|
throw new NullPointerException();
|
|
throw new NullPointerException();
|
|
}
|
|
}
|
|
@@ -139,7 +139,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
uncompressedDirectBuf.position(directBufferSize);
|
|
uncompressedDirectBuf.position(directBufferSize);
|
|
}
|
|
}
|
|
|
|
|
|
- synchronized void setInputFromSavedData() {
|
|
|
|
|
|
+ void setInputFromSavedData() {
|
|
compressedDirectBufOff = 0;
|
|
compressedDirectBufOff = 0;
|
|
compressedDirectBufLen = userBufLen;
|
|
compressedDirectBufLen = userBufLen;
|
|
if (compressedDirectBufLen > directBufferSize) {
|
|
if (compressedDirectBufLen > directBufferSize) {
|
|
@@ -157,7 +157,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized void setDictionary(byte[] b, int off, int len) {
|
|
|
|
|
|
+ public void setDictionary(byte[] b, int off, int len) {
|
|
if (stream == 0 || b == null) {
|
|
if (stream == 0 || b == null) {
|
|
throw new NullPointerException();
|
|
throw new NullPointerException();
|
|
}
|
|
}
|
|
@@ -169,7 +169,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized boolean needsInput() {
|
|
|
|
|
|
+ public boolean needsInput() {
|
|
// Consume remaining compressed data?
|
|
// Consume remaining compressed data?
|
|
if (uncompressedDirectBuf.remaining() > 0) {
|
|
if (uncompressedDirectBuf.remaining() > 0) {
|
|
return false;
|
|
return false;
|
|
@@ -189,19 +189,19 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized boolean needsDictionary() {
|
|
|
|
|
|
+ public boolean needsDictionary() {
|
|
return needDict;
|
|
return needDict;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized boolean finished() {
|
|
|
|
|
|
+ public boolean finished() {
|
|
// Check if 'zlib' says it's 'finished' and
|
|
// Check if 'zlib' says it's 'finished' and
|
|
// all compressed data has been consumed
|
|
// all compressed data has been consumed
|
|
return (finished && uncompressedDirectBuf.remaining() == 0);
|
|
return (finished && uncompressedDirectBuf.remaining() == 0);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized int decompress(byte[] b, int off, int len)
|
|
|
|
|
|
+ public int decompress(byte[] b, int off, int len)
|
|
throws IOException {
|
|
throws IOException {
|
|
if (b == null) {
|
|
if (b == null) {
|
|
throw new NullPointerException();
|
|
throw new NullPointerException();
|
|
@@ -240,7 +240,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
*
|
|
*
|
|
* @return the total (non-negative) number of uncompressed bytes output so far
|
|
* @return the total (non-negative) number of uncompressed bytes output so far
|
|
*/
|
|
*/
|
|
- public synchronized long getBytesWritten() {
|
|
|
|
|
|
+ public long getBytesWritten() {
|
|
checkStream();
|
|
checkStream();
|
|
return getBytesWritten(stream);
|
|
return getBytesWritten(stream);
|
|
}
|
|
}
|
|
@@ -250,7 +250,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
*
|
|
*
|
|
* @return the total (non-negative) number of compressed bytes input so far
|
|
* @return the total (non-negative) number of compressed bytes input so far
|
|
*/
|
|
*/
|
|
- public synchronized long getBytesRead() {
|
|
|
|
|
|
+ public long getBytesRead() {
|
|
checkStream();
|
|
checkStream();
|
|
return getBytesRead(stream);
|
|
return getBytesRead(stream);
|
|
}
|
|
}
|
|
@@ -263,7 +263,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
* @return the total (non-negative) number of unprocessed bytes in input
|
|
* @return the total (non-negative) number of unprocessed bytes in input
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public synchronized int getRemaining() {
|
|
|
|
|
|
+ public int getRemaining() {
|
|
checkStream();
|
|
checkStream();
|
|
return userBufLen + getRemaining(stream); // userBuf + compressedDirectBuf
|
|
return userBufLen + getRemaining(stream); // userBuf + compressedDirectBuf
|
|
}
|
|
}
|
|
@@ -272,7 +272,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
* Resets everything including the input buffers (user and direct).</p>
|
|
* Resets everything including the input buffers (user and direct).</p>
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public synchronized void reset() {
|
|
|
|
|
|
+ public void reset() {
|
|
checkStream();
|
|
checkStream();
|
|
reset(stream);
|
|
reset(stream);
|
|
finished = false;
|
|
finished = false;
|
|
@@ -284,7 +284,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized void end() {
|
|
|
|
|
|
+ public void end() {
|
|
if (stream != 0) {
|
|
if (stream != 0) {
|
|
end(stream);
|
|
end(stream);
|
|
stream = 0;
|
|
stream = 0;
|
|
@@ -372,7 +372,7 @@ public class ZlibDecompressor implements Decompressor {
|
|
private boolean endOfInput;
|
|
private boolean endOfInput;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized void decompress(ByteBuffer src, ByteBuffer dst)
|
|
|
|
|
|
+ public void decompress(ByteBuffer src, ByteBuffer dst)
|
|
throws IOException {
|
|
throws IOException {
|
|
assert dst.isDirect() : "dst.isDirect()";
|
|
assert dst.isDirect() : "dst.isDirect()";
|
|
assert src.isDirect() : "src.isDirect()";
|
|
assert src.isDirect() : "src.isDirect()";
|
|
@@ -382,13 +382,13 @@ public class ZlibDecompressor implements Decompressor {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized void setDictionary(byte[] b, int off, int len) {
|
|
|
|
|
|
+ public void setDictionary(byte[] b, int off, int len) {
|
|
throw new UnsupportedOperationException(
|
|
throw new UnsupportedOperationException(
|
|
"byte[] arrays are not supported for DirectDecompressor");
|
|
"byte[] arrays are not supported for DirectDecompressor");
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized int decompress(byte[] b, int off, int len) {
|
|
|
|
|
|
+ public int decompress(byte[] b, int off, int len) {
|
|
throw new UnsupportedOperationException(
|
|
throw new UnsupportedOperationException(
|
|
"byte[] arrays are not supported for DirectDecompressor");
|
|
"byte[] arrays are not supported for DirectDecompressor");
|
|
}
|
|
}
|