Increase (de)compress buffer sizes
This commit is contained in:
parent
36c14be025
commit
04a5e87fec
@ -1413,7 +1413,7 @@ object MatterManager {
|
|||||||
inflater.setInput(bbytes)
|
inflater.setInput(bbytes)
|
||||||
|
|
||||||
while (!inflater.finished()) {
|
while (!inflater.finished()) {
|
||||||
val chunk = ByteArray(4096)
|
val chunk = ByteArray(2 shl 16)
|
||||||
val inflated = inflater.inflate(chunk)
|
val inflated = inflater.inflate(chunk)
|
||||||
|
|
||||||
if (inflated == 0) {
|
if (inflated == 0) {
|
||||||
@ -1425,7 +1425,7 @@ object MatterManager {
|
|||||||
throw IndexOutOfBoundsException("Pipe Bomb")
|
throw IndexOutOfBoundsException("Pipe Bomb")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inflated == 4096) {
|
if (inflated == 2 shl 16) {
|
||||||
chunks.add(chunk)
|
chunks.add(chunk)
|
||||||
} else {
|
} else {
|
||||||
chunks.add(chunk.copyOfRange(0, inflated))
|
chunks.add(chunk.copyOfRange(0, inflated))
|
||||||
@ -1513,7 +1513,7 @@ object MatterManager {
|
|||||||
deflater.setInput(stream.array, 0, stream.length)
|
deflater.setInput(stream.array, 0, stream.length)
|
||||||
deflater.finish()
|
deflater.finish()
|
||||||
|
|
||||||
val bytes = ByteArray(4096)
|
val bytes = ByteArray(2 shl 16)
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
val written = deflater.deflate(bytes)
|
val written = deflater.deflate(bytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user