Java
6
Вклад в тег
public class Tmp {
ArrayList<Integer> LI = new ArrayList<Integer>() {{
LI.add(1231);
}};
}
public class ISToIteratorAdapter implements Iterator<Byte> {
private final InputStream is;
public ISToIteratorAdapter(InputStream is) {
this.is = is;
}
@Override
public boolean hasNext() {
try {
return is.available() > 0;
} catch (IOException e) {
return false;
}
}
@Override
public Byte next() {
try {
return Integer.valueOf(is.read()).byteValue();
} catch (IOException e) {
throw new NoSuchElementException();
}
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}