Package org.apache.pekko.util
Class ByteIterator.ByteArrayIterator
java.lang.Object
org.apache.pekko.util.ByteIterator
org.apache.pekko.util.ByteIterator.ByteArrayIterator
- 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>
- Enclosing class:
- ByteIterator
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pekko.util.ByteIterator
ByteIterator.ByteArrayIterator, ByteIterator.ByteArrayIterator$, ByteIterator.MultiByteArrayIterator, ByteIterator.MultiByteArrayIterator$ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ByteIterator$plus$plus(scala.collection.IterableOnce<Object> that) Directly wraps this ByteIterator in an InputStream without copying.voidclear()clone()<B> intcopyToArray(Object xs) <B> intcopyToArray(Object xs, int start) final <B> intcopyToArray(Object xs, int start, int len) intcopyToBuffer(ByteBuffer buffer) For performance sensitive code, call take() directly on ByteString (it's optimised there)drop(int n) getBytes(byte[] xs, int offset, int n) Get a specific number of Bytes from this iterator.getDoubles(double[] xs, int offset, int n, ByteOrder byteOrder) Get a number of Doubles from this iterator.Get a number of Floats from this iterator.Get a number of Ints from this iterator.Get a number of Longs from this iterator.Get a number of Shorts from this iterator.final booleanhasNext()final bytehead()final intlen()final bytenext()final intsize()take(int n) final ByteStringMethods inherited from class org.apache.pekko.util.ByteIterator
duplicate, foldLeft, foreach, getByte, getBytes, getBytes, getByteString, getDouble, getDoubles, getFloat, getFloats, getInt, getInts, getLong, getLongPart, getLongs, getShort, getShorts, indexOf, indexOf, indexOf, indexOf, indexWhere, indexWhere$default$2, slice, span, toArray, toSeqMethods 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, 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, 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, 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
-
ByteArrayIterator
public ByteArrayIterator()
-
-
Method Details
-
len
public final int len()- Specified by:
lenin classByteIterator
-
hasNext
public final boolean hasNext() -
head
public final byte head()- Specified by:
headin interfacescala.collection.BufferedIterator<Object>- Specified by:
headin classByteIterator
-
next
public final byte next()- Specified by:
nextin interfacescala.collection.Iterator<Object>- Specified by:
nextin classByteIterator
-
clear
public void clear()- Specified by:
clearin classByteIterator
-
size
public final int size() -
$plus$plus
- Overrides:
$plus$plusin classByteIterator
-
clone
- Overrides:
clonein classByteIterator
-
take
- Specified by:
takein interfacescala.collection.IterableOnceOps<Object,scala.collection.Iterator, scala.collection.Iterator<Object>> - Specified by:
takein interfacescala.collection.Iterator<Object>- Overrides:
takein classByteIterator
-
drop
- Specified by:
dropin interfacescala.collection.IterableOnceOps<Object,scala.collection.Iterator, scala.collection.Iterator<Object>> - Specified by:
dropin interfacescala.collection.Iterator<Object>- Overrides:
dropin classByteIterator
-
takeWhile
- Specified by:
takeWhilein interfacescala.collection.IterableOnceOps<Object,scala.collection.Iterator, scala.collection.Iterator<Object>> - Specified by:
takeWhilein interfacescala.collection.Iterator<Object>- Overrides:
takeWhilein classByteIterator
-
dropWhile
- Specified by:
dropWhilein interfacescala.collection.IterableOnceOps<Object,scala.collection.Iterator, scala.collection.Iterator<Object>> - Specified by:
dropWhilein interfacescala.collection.Iterator<Object>- Overrides:
dropWhilein classByteIterator
-
copyToArray
-
copyToArray
-
copyToArray
-
toByteString
- Specified by:
toByteStringin classByteIterator
-
getBytes
public ByteIterator.ByteArrayIterator getBytes(byte[] xs, int offset, int n) throws NoSuchElementException Description copied from class:ByteIteratorGet 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.- Specified by:
getBytesin classByteIterator- Throws:
NoSuchElementException
-
getShorts
Description copied from class:ByteIteratorGet a number of Shorts from this iterator.- Specified by:
getShortsin classByteIterator
-
getInts
Description copied from class:ByteIteratorGet a number of Ints from this iterator.- Specified by:
getIntsin classByteIterator
-
getLongs
Description copied from class:ByteIteratorGet a number of Longs from this iterator.- Specified by:
getLongsin classByteIterator
-
getFloats
Description copied from class:ByteIteratorGet a number of Floats from this iterator.- Specified by:
getFloatsin classByteIterator
-
getDoubles
public ByteIterator.ByteArrayIterator getDoubles(double[] xs, int offset, int n, ByteOrder byteOrder) Description copied from class:ByteIteratorGet a number of Doubles from this iterator.- Specified by:
getDoublesin classByteIterator
-
copyToBuffer
Description copied from class:ByteIteratorFor performance sensitive code, call take() directly on ByteString (it's optimised there)- Specified by:
copyToBufferin classByteIterator
-
asInputStream
Description copied from class:ByteIteratorDirectly wraps this ByteIterator in an InputStream without copying. Read and skip operations on the stream will advance the iterator accordingly.- Specified by:
asInputStreamin classByteIterator
-