69 lines
1.6 KiB
Java
69 lines
1.6 KiB
Java
package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;
|
||
|
||
import java.util.PrimitiveIterator;
|
||
import java.util.function.Consumer;
|
||
|
||
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.M02ᒾ;
|
||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||
|
||
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||
public interface PrimitiveByteIterator extends PrimitiveIterator<Byte,PrimitiveByteConsumer> {
|
||
|
||
byte nextByte();
|
||
|
||
@Override
|
||
default Byte next() {
|
||
return nextByte();
|
||
}
|
||
|
||
@Override
|
||
default void forEachRemaining(Consumer<? super Byte> action) {
|
||
while (hasNext()) {
|
||
action.accept(nextByte());
|
||
}
|
||
}
|
||
|
||
@Override
|
||
default void forEachRemaining(PrimitiveByteConsumer action) {
|
||
while (hasNext()) {
|
||
action.accept(nextByte());
|
||
}
|
||
}
|
||
|
||
default PrimitiveNibbleIterator toNibbleIteratorIndianBig() {
|
||
return toNibbleIterator(M02ᒾ.STATIC);
|
||
}
|
||
|
||
default PrimitiveNibbleIterator toNibbleIteratorIndianLittle() {
|
||
return toNibbleIterator(M02ᒾ.TAIL);
|
||
}
|
||
|
||
default PrimitiveNibbleIterator toNibbleIterator(M02ᒾ order) {
|
||
return new PrimitiveNibbleIterator() {
|
||
int offset = 0;
|
||
byte current = 0;
|
||
|
||
@Override
|
||
public boolean hasNext() {
|
||
if (offset > 0) {
|
||
return true;
|
||
}
|
||
return PrimitiveByteIterator.this.hasNext();
|
||
}
|
||
|
||
@Override
|
||
public byte nextNibble() {
|
||
if (offset == 0) {
|
||
current = PrimitiveByteIterator.this.nextByte();
|
||
}
|
||
int value = (current >> (order.rȧñkNummerBlokWaarde(offset) * 4)) & 0x0F;
|
||
offset++;
|
||
if (offset == 2) {
|
||
offset = 0;
|
||
}
|
||
return (byte) value;
|
||
}
|
||
};
|
||
}
|
||
}
|