Skip to content

Commit 80ffb00

Browse files
committed
PrimitiveIterator.OfInt BAIS
1 parent 56ddd96 commit 80ffb00

File tree

1 file changed

+12
-1
lines changed
  • src/main/java/com/trivago/fastutilconcurrentwrapper/io

1 file changed

+12
-1
lines changed

src/main/java/com/trivago/fastutilconcurrentwrapper/io/BAIS.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.io.ObjectInput;
1414
import java.io.ObjectInputStream;
1515
import java.io.UTFDataFormatException;
16+
import java.util.PrimitiveIterator;
1617
import java.util.UUID;
1718

1819
/**
@@ -26,7 +27,7 @@
2627
@author Andrej Fink [https://magicprinc.github.io]
2728
*/
2829
@SuppressWarnings({"NonSynchronizedMethodOverridesSynchronizedMethod", "ResultOfMethodCallIgnored"})
29-
public class BAIS extends ByteArrayInputStream implements ObjectInput, MeasurableStream, RepositionableStream, SafeCloseable {
30+
public class BAIS extends ByteArrayInputStream implements ObjectInput, MeasurableStream, RepositionableStream, SafeCloseable, PrimitiveIterator.OfInt {
3031
protected int offset;
3132

3233
public BAIS (byte[] array, @PositiveOrZero int offset, @PositiveOrZero int maxLength) {
@@ -283,4 +284,14 @@ public String readLatin1String (@PositiveOrZero int strLen) {
283284
pos += strLen;
284285
return s;
285286
}
287+
288+
@Override
289+
public boolean hasNext () {
290+
return available() > 0;
291+
}
292+
293+
@Override
294+
public int nextInt () {
295+
return read();
296+
}
286297
}

0 commit comments

Comments
 (0)