/** * Calls to ArrayUtils to enlarge the buffer in a specified amount, and copy the * data to a new location. * @param enlarge amount the buffer expects to grow. * @throws IOException if an I/O error occurs. */ private void enlargeBuffer(final int enlarge) throws IOException{ int preLen = buffer.length; buffer = ArrayUtils.grow(buffer, buffer.length + enlarge); avail += buffer.length - preLen; }
/** * Calls to ArrayUtils to enlarge the buffer in a specified amount, and copy the * data to a new location. * @param enlarge amount the buffer expects to grow. * @throws IOException if an I/O error occurs. */ private void enlargeBuffer(final int enlarge) throws IOException{ int preLen = buffer.length; buffer = ArrayUtils.grow(buffer, buffer.length + enlarge); avail += buffer.length - preLen; }
/** * Checks if the buffer needs to be reallocated, and if it is the case, it calls to ArrayUtils to enlarge it and copy the * data to a new location * @throws IOException if an I/O error occurs */ private void enlargeBuffer() throws IOException { if(avail == 0){ int preLen = buffer.length; buffer = ArrayUtils.grow(buffer, buffer.length + enlargeQ); avail = buffer.length - preLen; } }
/** * Checks if the buffer needs to be reallocated, and if it is the case, it calls to ArrayUtils to enlarge it and copy the * data to a new location * @throws IOException if an I/O error occurs */ private void enlargeBuffer() throws IOException { if(avail == 0){ int preLen = buffer.length; buffer = ArrayUtils.grow(buffer, buffer.length + enlargeQ); avail = buffer.length - preLen; } }
public static byte[] growOrCreate(byte[] arr, int len) { return (arr == null) ? new byte[len] : grow(arr, len); }
public static int[] growOrCreate(int[] arr, int len) { return (arr == null) ? new int[len] : grow(arr, len); }
public static byte[] growOrCreate(byte[] arr, int len) { return (arr == null) ? new byte[len] : grow(arr, len); }
public static int[] growOrCreate(int[] arr, int len) { return (arr == null) ? new int[len] : grow(arr, len); }
public final void setup(ByteIn in, int bytes) throws IOException { buffer = ArrayUtils.grow(buffer, bytes+1); in.readFully(buffer, 0, bytes); //System.err.println("decompressing" + Arrays.toString(Arrays.copyOf(buffer, bytes))); pos = 0; offset = 0; bitOffset = 0; byteRead = buffer[pos]; pos++; }
public final void setup(ByteIn in, int bytes) throws IOException { buffer = ArrayUtils.grow(buffer, bytes+1); in.readFully(buffer, 0, bytes); //System.err.println("decompressing" + Arrays.toString(Arrays.copyOf(buffer, bytes))); pos = 0; offset = 0; bitOffset = 0; byteRead = buffer[pos]; pos++; }
blocks = ArrayUtils.grow(blocks, cnt + b.length); System.arraycopy(b, 0, blocks, cnt, b.length); cnt += b.length;
blocks = ArrayUtils.grow(blocks, cnt + b.length); System.arraycopy(b, 0, blocks, cnt, b.length); cnt += b.length;