private ByteBuffer expandPage(int page) { final ByteBuffer d = buffers[page].get(); if (d.capacity() == BLOCK_SIZE) { // already expanded, or not compressed return d; } synchronized (d) { if (d.capacity() == BLOCK_SIZE) { return d; } ByteBuffer out = ByteBuffer.allocateDirect(BLOCK_SIZE); if (d != COMPRESSED_EMPTY_BLOCK) { d.position(0); CompressLZF.expand(d, out); } buffers[page].compareAndSet(d, out); return out; } }
private byte[] expand(int page) { byte[] d = getPage(page); if (d.length == BLOCK_SIZE) { return d; } byte[] out = new byte[BLOCK_SIZE]; if (d != COMPRESSED_EMPTY_BLOCK) { synchronized (LZF) { LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE); } } setPage(page, d, out, false); return out; }
private void fillBuffer() throws IOException { if (buffer != null && pos < bufferLength) { return; } int len = readInt(); if (decompress == null) { // EOF this.bufferLength = 0; } else if (len < 0) { len = -len; buffer = ensureSize(buffer, len); readFully(buffer, len); this.bufferLength = len; } else { inBuffer = ensureSize(inBuffer, len); int size = readInt(); readFully(inBuffer, len); buffer = ensureSize(buffer, size); try { decompress.expand(inBuffer, 0, len, buffer, 0, size); } catch (ArrayIndexOutOfBoundsException e) { DbException.convertToIOException(e); } this.bufferLength = size; } pos = 0; }
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data, 0, pageSize); } catch (ArrayIndexOutOfBoundsException e) { throw DbException.convertToIOException(e);
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data.getBytes(), 0, store.getPageSize()); } catch (ArrayIndexOutOfBoundsException e) {
private static void expand(byte[][] data, int i) { byte[] d = data[i]; if (d.length == BLOCK_SIZE) { return; } byte[] out = new byte[BLOCK_SIZE]; synchronized (LZF) { LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE); } data[i] = out; }
private void expand(int page) { byte[] d = data[page]; if (d.length == BLOCK_SIZE) { return; } byte[] out = new byte[BLOCK_SIZE]; if (d != COMPRESSED_EMPTY_BLOCK) { synchronized (LZF) { LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE); } } data[page] = out; }
private static void expand(byte[][] data, int page) { byte[] d = data[page]; if (d.length == BLOCK_SIZE) { return; } byte[] out = new byte[BLOCK_SIZE]; if (d != COMPRESSED_EMPTY_BLOCK) { synchronized (LZF) { LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE); } } data[page] = out; }
private static void expand(ByteBuffer[] data, int page) { ByteBuffer d = data[page]; if (d.capacity() == BLOCK_SIZE) { return; } ByteBuffer out = ByteBuffer.allocateDirect(BLOCK_SIZE); if (d != COMPRESSED_EMPTY_BLOCK) { synchronized (LZF) { d.position(0); CompressLZF.expand(d, out); } } data[page] = out; }
private void expand(int page) { ByteBuffer[] list = data; if (page >= list.length) { // was truncated return; } ByteBuffer d = list[page]; if (d.capacity() == BLOCK_SIZE) { // already expanded, or not compressed return; } ByteBuffer out = ByteBuffer.allocateDirect(BLOCK_SIZE); if (d != COMPRESSED_EMPTY_BLOCK) { synchronized (LZF) { d.position(0); CompressLZF.expand(d, out); } } list[page] = out; }
private void fillBuffer() throws IOException { if (buffer != null && pos < bufferLength) { return; } int len = readInt(); if (decompress == null) { // EOF this.bufferLength = 0; } else if (len < 0) { len = -len; buffer = ensureSize(buffer, len); readFully(buffer, len); this.bufferLength = len; } else { inBuffer = ensureSize(inBuffer, len); int size = readInt(); readFully(inBuffer, len); buffer = ensureSize(buffer, size); decompress.expand(inBuffer, 0, len, buffer, 0, size); this.bufferLength = size; } pos = 0; }
private void fillBuffer() throws IOException { if (buffer != null && pos < bufferLength) { return; } int len = readInt(); if (decompress == null) { // EOF this.bufferLength = 0; } else if (len < 0) { len = -len; buffer = ensureSize(buffer, len); readFully(buffer, len); this.bufferLength = len; } else { inBuffer = ensureSize(inBuffer, len); int size = readInt(); readFully(inBuffer, len); buffer = ensureSize(buffer, size); try { decompress.expand(inBuffer, 0, len, buffer, 0, size); } catch (ArrayIndexOutOfBoundsException e) { DbException.convertToIOException(e); } this.bufferLength = size; } pos = 0; }
private void fillBuffer() throws IOException { if (buffer != null && pos < bufferLength) { return; } int len = readInt(); if (decompress == null) { // EOF this.bufferLength = 0; } else if (len < 0) { len = -len; buffer = ensureSize(buffer, len); readFully(buffer, len); this.bufferLength = len; } else { inBuffer = ensureSize(inBuffer, len); int size = readInt(); readFully(inBuffer, len); buffer = ensureSize(buffer, size); try { decompress.expand(inBuffer, 0, len, buffer, 0, size); } catch (ArrayIndexOutOfBoundsException e) { DbException.convertToIOException(e); } this.bufferLength = size; } pos = 0; }
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data, 0, pageSize); } catch (ArrayIndexOutOfBoundsException e) { throw DbException.convertToIOException(e);
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data, 0, pageSize); } catch (ArrayIndexOutOfBoundsException e) { throw DbException.convertToIOException(e);
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data.getBytes(), 0, store.getPageSize()); } catch (ArrayIndexOutOfBoundsException e) {
in.readFully(compressBuffer, size); try { compress.expand(compressBuffer, 0, size, data.getBytes(), 0, store.getPageSize()); } catch (ArrayIndexOutOfBoundsException e) {