@Test public void testClear() { int capacity = 16; CircularByteBuffer buffer = new CircularByteBuffer(capacity); buffer.put(new byte[4]); buffer.clear(); assertEquals(0, buffer.available()); assertEquals(capacity, buffer.free()); assertEquals(16, buffer.put(new byte[16])); }
public synchronized void clear() { idxGet = idxPut = available = 0; }
CircularByteBuffer { public synchronized void clear() { idxGet = idxPut = available = 0; } }
CircularByteBuffer { public synchronized void clear() { idxGet = idxPut = available = 0; } CircularByteBuffer();  CircularByteBuffer(int capacity); }
CircularByteBuffer { public synchronized void clear() { idxGet = idxPut = available = 0; } CircularByteBuffer();  CircularByteBuffer(int capacity); synchronized void clear(); synchronized int get(); int get(byte[] dst); synchronized int get(byte[] dst, int off, int len); synchronized boolean put(byte value); int put(byte[] src); synchronized int put(byte[] src, int off, int len); synchronized int peek(); synchronized int skip(int count); int capacity(); synchronized int available(); synchronized int free(); }
CircularByteBuffer { public synchronized void clear() { idxGet = idxPut = available = 0; } CircularByteBuffer();  CircularByteBuffer(int capacity); synchronized void clear(); synchronized int get(); int get(byte[] dst); synchronized int get(byte[] dst, int off, int len); synchronized boolean put(byte value); int put(byte[] src); synchronized int put(byte[] src, int off, int len); synchronized int peek(); synchronized int skip(int count); int capacity(); synchronized int available(); synchronized int free();  }