| 13 | package clojure.lang; |
| 14 | |
| 15 | final public class ChunkBuffer implements Counted{ |
| 16 | Object[] buffer; |
| 17 | int end; |
| 18 | |
| 19 | public ChunkBuffer(int capacity){ |
| 20 | buffer = new Object[capacity]; |
| 21 | end = 0; |
| 22 | } |
| 23 | |
| 24 | public void add(Object o){ |
| 25 | buffer[end++] = o; |
| 26 | } |
| 27 | |
| 28 | public IChunk chunk(){ |
| 29 | ArrayChunk ret = new ArrayChunk(buffer, 0, end); |
| 30 | buffer = null; |
| 31 | return ret; |
| 32 | } |
| 33 | |
| 34 | public int count(){ |
| 35 | return end; |
| 36 | } |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected