2022-10-31 04:39:32 +01:00
|
|
|
package ᒢᐩᐩ.ᒼᐤᒻᒻᓫᒼᐪᑊᐤᣕᔆ;
|
2022-10-23 03:04:55 +02:00
|
|
|
|
|
|
|
|
import java.util.PrimitiveIterator;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
2022-10-31 04:39:32 +01:00
|
|
|
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
|
|
|
|
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.M02MatrixBinary;
|
2022-10-23 03:04:55 +02:00
|
|
|
|
2022-10-30 16:59:24 +01:00
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-10-23 03:04:55 +02: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 08:26:14 +01:00
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianBig() {
|
|
|
|
|
return toNibbleIterator(M02MatrixBinary.STATIC);
|
2022-10-23 03:04:55 +02:00
|
|
|
}
|
|
|
|
|
|
2022-10-30 08:26:14 +01:00
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianLittle() {
|
|
|
|
|
return toNibbleIterator(M02MatrixBinary.TAIL);
|
2022-10-23 03:04:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default PrimitiveNibbleIterator toNibbleIterator(M02MatrixBinary order) {
|
|
|
|
|
return new PrimitiveNibbleIterator() {
|
2022-10-30 08:26:14 +01:00
|
|
|
int offset = 0;
|
2022-10-23 03:04:55 +02:00
|
|
|
byte current = 0;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasNext() {
|
2022-10-30 08:26:14 +01:00
|
|
|
if (offset > 0) {
|
|
|
|
|
return true;
|
2022-10-23 03:04:55 +02:00
|
|
|
}
|
2022-10-30 08:26:14 +01:00
|
|
|
return PrimitiveByteIterator.this.hasNext();
|
2022-10-23 03:04:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public byte nextNibble() {
|
2022-10-30 08:26:14 +01: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 03:04:55 +02:00
|
|
|
}
|
|
|
|
|
return (byte) value;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|