@Test public void testClear() { ByteBag bag; bag = new ByteBag(); bag.set(0, (byte) 1); bag.set(1, (byte) 1); bag.set(63, (byte) 1); bag.clear(); assertEquals((Byte) (byte) 0, (Byte) bag.get(0)); assertEquals((Byte) (byte) 0, (Byte) bag.get(1)); assertEquals((Byte) (byte) 0, (Byte) bag.get(63)); assertEquals(64, bag.buffer.length); Mask mask = new Mask(); bag = new ByteBag(); bag.set(0, (byte) 1); bag.set(1, (byte) 1); bag.set(63, (byte) 1); mask.set(63); mask.set(0); bag.clear(mask); assertEquals((Byte) (byte) 0, (Byte) bag.get(0)); assertNotEquals((Byte) (byte) 0, (Byte) bag.get(1)); assertEquals((Byte) (byte) 0, (Byte) bag.get(63)); mask.set(1); mask.set(457); bag.clear(mask); assertEquals((Byte) (byte) 0, (Byte) bag.get(0)); assertEquals((Byte) (byte) 0, (Byte) bag.get(1)); assertEquals((Byte) (byte) 0, (Byte) bag.get(63)); assertEquals(64, bag.buffer.length); }
@Override public void clear() { byte[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = (byte) 0; }
ByteBag implements AnyBag<ByteBag> { @Override public void clear() { byte[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = (byte) 0; } }
ByteBag implements AnyBag<ByteBag> { @Override public void clear() { byte[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = (byte) 0; } ByteBag(); }
ByteBag implements AnyBag<ByteBag> { @Override public void clear() { byte[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = (byte) 0; } ByteBag(); @Override void copyFrom(ByteBag from); @Override void copyFrom(ByteBag from, boolean clearExceeding); @Override void copyFrom(ByteBag from, int length); @Override void copyFrom(ByteBag from, int length, boolean clearExceeding); @Override void copyFrom(ByteBag from, int fromOffset, int length); @Override void copyFrom(ByteBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(ByteBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); byte get(int index); void set(int index, byte value); @Override void clear(); @Override void clear(Mask mask); }
ByteBag implements AnyBag<ByteBag> { @Override public void clear() { byte[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = (byte) 0; } ByteBag(); @Override void copyFrom(ByteBag from); @Override void copyFrom(ByteBag from, boolean clearExceeding); @Override void copyFrom(ByteBag from, int length); @Override void copyFrom(ByteBag from, int length, boolean clearExceeding); @Override void copyFrom(ByteBag from, int fromOffset, int length); @Override void copyFrom(ByteBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(ByteBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); byte get(int index); void set(int index, byte value); @Override void clear(); @Override void clear(Mask mask); @Experimental
    public byte[] buffer; }