Package org.apache.pekko.util
Class ByteIterator
java.lang.Object
org.apache.pekko.util.ByteIterator
- All Implemented Interfaces:
scala.collection.BufferedIterator<Object>,scala.collection.IterableOnce<Object>,scala.collection.IterableOnceOps<Object,,scala.collection.Iterator, scala.collection.Iterator<Object>> scala.collection.Iterator<Object>
- Direct Known Subclasses:
ByteIterator.ByteArrayIterator,ByteIterator.MultiByteArrayIterator
public abstract class ByteIterator
extends Object
implements scala.collection.BufferedIterator<Object>
An iterator over a ByteString.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription$plus$plus(scala.collection.IterableOnce<Object> that) abstract InputStreamDirectly wraps this ByteIterator in an InputStream without copying.protected abstract voidclear()clone()abstract intcopyToBuffer(ByteBuffer buffer) For performance sensitive code, call take() directly on ByteString (it's optimised there)drop(int n) scala.Tuple2<ByteIterator,ByteIterator> <B> B<U> voidbytegetByte()Get a single Byte from this iterator.getBytes(byte[] xs) Get a specific number of Bytes from this iterator.abstract ByteIteratorgetBytes(byte[] xs, int offset, int n) Get a specific number of Bytes from this iterator.byte[]getBytes(int n) Get a specific number of Bytes from this iterator.getByteString(int n) Get a ByteString with specific number of Bytes from this iterator.doubleabstract ByteIteratorgetDoubles(double[] xs, int offset, int n, ByteOrder byteOrder) Get a number of Doubles from this iterator.getDoubles(double[] xs, ByteOrder byteOrder) Get a number of Doubles from this iterator.floatabstract ByteIteratorGet a number of Floats from this iterator.Get a number of Floats from this iterator.intGet a single Int from this iterator.abstract ByteIteratorGet a number of Ints from this iterator.Get a number of Ints from this iterator.longGet a single Long from this iterator.longgetLongPart(int n, ByteOrder byteOrder) Get a Long from this iterator where only the least significantnbytes were encoded.abstract ByteIteratorGet a number of Longs from this iterator.Get a number of Longs from this iterator.shortGet a single Short from this iterator.abstract ByteIteratorGet a number of Shorts from this iterator.Get a number of Shorts from this iterator.abstract bytehead()intindexOf(byte elem) intindexOf(byte elem, int from) <B> intindexOf(B elem) <B> intindexOf(B elem, int from) intindexWhere(scala.Function1<Object, Object> p, int from) intabstract intlen()abstract bytenext()slice(int from, int until) scala.Tuple2<ByteIterator,ByteIterator> take(int n) <B> ObjecttoArray(scala.reflect.ClassTag<B> arg0) abstract ByteStringtoSeq()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface scala.collection.BufferedIterator
buffered, headOptionMethods inherited from interface scala.collection.IterableOnce
knownSize, stepperMethods inherited from interface scala.collection.IterableOnceOps
$colon$bslash, $div$colon, addString, addString, addString, aggregate, collectFirst, copyToArray, copyToArray, copyToArray, copyToBuffer, corresponds, count, exists, find, fold, foldRight, forall, isTraversableAgain, max, maxBy, maxByOption, maxOption, min, minBy, minByOption, minOption, mkString, mkString, mkString, nonEmpty, product, reduce, reduceLeft, reduceLeftOption, reduceOption, reduceRight, reduceRightOption, reversed, size, splitAt, sum, to, toBuffer, toIndexedSeq, toIterator, toList, toMap, toSet, toStream, toVectorMethods inherited from interface scala.collection.Iterator
$plus$plus, collect, concat, contains, distinct, distinctBy, filter, filterImpl, filterNot, flatMap, flatten, grouped, hasDefiniteSize, hasNext, isEmpty, iterator, length, map, nextOption, padTo, partition, patch, sameElements, scanLeft, scanRight, seq, sliceIterator, sliding, sliding$default$2, tapEach, toString, withFilter, zip, zipAll, zipWithIndex
-
Constructor Details
-
ByteIterator
public ByteIterator()
-
-
Method Details
-
len
public abstract int len() -
head
public abstract byte head()- Specified by:
headin interfacescala.collection.BufferedIterator<Object>
-
next
public abstract byte next()- Specified by:
nextin interfacescala.collection.Iterator<Object>
-
clear
protected abstract void clear() -
$plus$plus
-
clone
-
duplicate
- Specified by:
duplicatein interfacescala.collection.Iterator<Object>
-
take
-
drop
-
slice
-
takeWhile
-
dropWhile
-
span
-
indexWhere
- Specified by:
indexWherein interfacescala.collection.Iterator<Object>
-
indexWhere$default$2
public int indexWhere$default$2()- Specified by:
indexWhere$default$2in interfacescala.collection.Iterator<Object>
-
indexOf
public int indexOf(byte elem) -
indexOf
public int indexOf(byte elem, int from) -
indexOf
public <B> int indexOf(B elem) - Specified by:
indexOfin interfacescala.collection.Iterator<Object>
-
indexOf
public <B> int indexOf(B elem, int from) - Specified by:
indexOfin interfacescala.collection.Iterator<Object>
-
toByteString
-
toSeq
-
foreach
-
foldLeft
-
toArray
-
getByte
public byte getByte()Get a single Byte from this iterator. Identical to next(). -
getShort
Get a single Short from this iterator. -
getInt
Get a single Int from this iterator. -
getLong
Get a single Long from this iterator. -
getLongPart
Get a Long from this iterator where only the least significantnbytes were encoded. -
getFloat
-
getDouble
-
getBytes
Get a specific number of Bytes from this iterator. In contrast to copyToArray, this method will fail if this.len < xs.length. -
getBytes
Get a specific number of Bytes from this iterator. In contrast to copyToArray, this method will fail if length < n or if (xs.length - offset) < n. -
getBytes
public byte[] getBytes(int n) Get a specific number of Bytes from this iterator. In contrast to copyToArray, this method will fail if this.len < n. -
getByteString
Get a ByteString with specific number of Bytes from this iterator. In contrast to copyToArray, this method will fail if this.len < n. -
getShorts
Get a number of Shorts from this iterator. -
getShorts
Get a number of Shorts from this iterator. -
getInts
Get a number of Ints from this iterator. -
getInts
Get a number of Ints from this iterator. -
getLongs
Get a number of Longs from this iterator. -
getLongs
Get a number of Longs from this iterator. -
getFloats
Get a number of Floats from this iterator. -
getFloats
Get a number of Floats from this iterator. -
getDoubles
Get a number of Doubles from this iterator. -
getDoubles
Get a number of Doubles from this iterator. -
copyToBuffer
For performance sensitive code, call take() directly on ByteString (it's optimised there) -
asInputStream
Directly wraps this ByteIterator in an InputStream without copying. Read and skip operations on the stream will advance the iterator accordingly.
-