public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }
public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }
public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }
public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }
public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }
public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) { int totalSize = lastChunkEntries + _bufferedEntryCount; T resultArray = _constructArray(totalSize); int ptr = 0; for (Node<T> n = _bufferHead; n != null; n = n.next()) { ptr = n.copyData(resultArray, ptr); } System.arraycopy(lastChunk, 0, resultArray, ptr, lastChunkEntries); ptr += lastChunkEntries; // sanity check (could have failed earlier due to out-of-bounds, too) if (ptr != totalSize) { throw new IllegalStateException("Should have gotten "+totalSize+" entries, got "+ptr); } return resultArray; }