2022-11-05 12:51:51 +00:00
|
|
|
|
package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;
|
2022-10-23 01:04:55 +00:00
|
|
|
|
|
|
|
|
|
import java.util.PrimitiveIterator;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
2022-11-07 19:35:56 +00:00
|
|
|
|
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.M02ᒾ;
|
2022-11-05 12:41:48 +00:00
|
|
|
|
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
2022-10-23 01:04:55 +00:00
|
|
|
|
|
2022-10-30 15:59:24 +00:00
|
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-10-23 01:04:55 +00:00
|
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-30 07:26:14 +00:00
|
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianBig() {
|
2022-11-07 19:35:56 +00:00
|
|
|
|
return toNibbleIterator(M02ᒾ.STATIC);
|
2022-10-23 01:04:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-30 07:26:14 +00:00
|
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianLittle() {
|
2022-11-07 19:35:56 +00:00
|
|
|
|
return toNibbleIterator(M02ᒾ.TAIL);
|
2022-10-23 01:04:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-07 19:35:56 +00:00
|
|
|
|
default PrimitiveNibbleIterator toNibbleIterator(M02ᒾ order) {
|
2022-10-23 01:04:55 +00:00
|
|
|
|
return new PrimitiveNibbleIterator() {
|
2022-10-30 07:26:14 +00:00
|
|
|
|
int offset = 0;
|
2022-10-23 01:04:55 +00:00
|
|
|
|
byte current = 0;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasNext() {
|
2022-10-30 07:26:14 +00:00
|
|
|
|
if (offset > 0) {
|
|
|
|
|
return true;
|
2022-10-23 01:04:55 +00:00
|
|
|
|
}
|
2022-10-30 07:26:14 +00:00
|
|
|
|
return PrimitiveByteIterator.this.hasNext();
|
2022-10-23 01:04:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public byte nextNibble() {
|
2022-10-30 07:26:14 +00:00
|
|
|
|
if (offset == 0) {
|
|
|
|
|
current = PrimitiveByteIterator.this.nextByte();
|
|
|
|
|
}
|
|
|
|
|
int value = (current >> (order.rȧñkNummerBlokWaarde(offset) * 4)) & 0x0F;
|
|
|
|
|
offset++;
|
|
|
|
|
if (offset == 2) {
|
|
|
|
|
offset = 0;
|
2022-10-23 01:04:55 +00:00
|
|
|
|
}
|
|
|
|
|
return (byte) value;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|