]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.compressions/src/org/simantics/compressions/impl/DecompressingInputStream.java
Refresh native part of org.simantics.fastlz compilation instructions.
[simantics/platform.git] / bundles / org.simantics.compressions / src / org / simantics / compressions / impl / DecompressingInputStream.java
index 8c7987177fb32145fe27d62a0c0a7585d998ab38..9329d83c4328f68398cabc8418e153d802b09246 100644 (file)
@@ -134,16 +134,20 @@ public abstract class DecompressingInputStream extends InputStream {
         return true;\r
     }\r
 \r
-    private static ByteBuffer ensureBufferSize(ByteBuffer buffer, int minCapacity) {\r
+    private ByteBuffer ensureBufferSize(ByteBuffer buffer, int minCapacity) {\r
         int oldCapacity = buffer != null ? buffer.capacity() : 0;\r
         if (buffer == null || oldCapacity < minCapacity) {\r
             int newCapacity = grow(oldCapacity, minCapacity);\r
             //System.out.println("ensureBufferSize(" + oldCapacity + ", " + minCapacity + "), new capacity " + newCapacity);\r
-            buffer = ByteBuffer.allocateDirect(newCapacity);\r
+            buffer = allocateBuffer(newCapacity);\r
         }\r
         return buffer;\r
     }\r
 \r
+    protected ByteBuffer allocateBuffer(int capacity) {\r
+        return ByteBuffer.allocateDirect(capacity);\r
+    }\r
+    \r
     /**\r
      * @param oldCapacity current capacity of a buffer\r
      * @param minCapacity\r