|
|
@ -33,9 +33,7 @@ object Js5Compression { |
|
|
|
val start = output.writerIndex() |
|
|
|
val start = output.writerIndex() |
|
|
|
|
|
|
|
|
|
|
|
type.createOutputStream(ByteBufOutputStream(output)).use { outputStream -> |
|
|
|
type.createOutputStream(ByteBufOutputStream(output)).use { outputStream -> |
|
|
|
ByteBufInputStream(input).use { inputStream -> |
|
|
|
input.readBytes(outputStream, input.readableBytes()) |
|
|
|
inputStream.copyTo(outputStream) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val len = output.writerIndex() - start |
|
|
|
val len = output.writerIndex() - start |
|
|
@ -103,9 +101,7 @@ object Js5Compression { |
|
|
|
|
|
|
|
|
|
|
|
plaintext.alloc().buffer(uncompressedLen, uncompressedLen).use { output -> |
|
|
|
plaintext.alloc().buffer(uncompressedLen, uncompressedLen).use { output -> |
|
|
|
type.createInputStream(ByteBufInputStream(plaintext, len), uncompressedLen).use { inputStream -> |
|
|
|
type.createInputStream(ByteBufInputStream(plaintext, len), uncompressedLen).use { inputStream -> |
|
|
|
ByteBufOutputStream(output).use { outputStream -> |
|
|
|
output.writeBytes(inputStream, output.writableBytes()) |
|
|
|
inputStream.copyTo(outputStream) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return output.retain() |
|
|
|
return output.retain() |
|
|
|