1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.util.Iterator ; 20 21 import org.apache.commons.collections.primitives.ByteIterator; 22 23 35 public class ByteIteratorIterator implements Iterator { 36 37 49 public static Iterator wrap(ByteIterator iterator) { 50 return null == iterator ? null : new ByteIteratorIterator(iterator); 51 } 52 53 58 public ByteIteratorIterator(ByteIterator iterator) { 59 _iterator = iterator; 60 } 61 62 public boolean hasNext() { 63 return _iterator.hasNext(); 64 } 65 66 public Object next() { 67 return new Byte (_iterator.next()); 68 } 69 70 public void remove() { 71 _iterator.remove(); 72 } 73 74 private ByteIterator _iterator = null; 75 76 } 77 | Popular Tags |