Package akka.util
Class ByteIterator.ByteArrayIterator
- java.lang.Object
-
- akka.util.ByteIterator
-
- akka.util.ByteIterator.ByteArrayIterator
-
- All Implemented Interfaces:
scala.collection.BufferedIterator<java.lang.Object>
,scala.collection.IterableOnce<java.lang.Object>
,scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterator,scala.collection.Iterator<java.lang.Object>>
,scala.collection.Iterator<java.lang.Object>
- Enclosing class:
- ByteIterator
public static class ByteIterator.ByteArrayIterator extends ByteIterator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.util.ByteIterator
ByteIterator.ByteArrayIterator, ByteIterator.ByteArrayIterator$, ByteIterator.MultiByteArrayIterator, ByteIterator.MultiByteArrayIterator$
-
-
Constructor Summary
Constructors Constructor Description ByteArrayIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteIterator
$plus$plus(scala.collection.IterableOnce<java.lang.Object> that)
byte[]
array()
java.io.InputStream
asInputStream()
Directly wraps this ByteIterator in an InputStream without copying.void
clear()
ByteIterator.ByteArrayIterator
clone()
<B> int
copyToArray(java.lang.Object xs)
<B> int
copyToArray(java.lang.Object xs, int start)
<B> int
copyToArray(java.lang.Object xs, int start, int len)
int
copyToBuffer(java.nio.ByteBuffer buffer)
For performance sensitive code, call take() directly on ByteString (it's optimised there)ByteIterator.ByteArrayIterator
drop(int n)
ByteIterator.ByteArrayIterator
dropWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
int
from()
ByteIterator.ByteArrayIterator
getBytes(byte[] xs, int offset, int n)
Get a specific number of Bytes from this iterator.ByteIterator.ByteArrayIterator
getDoubles(double[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Get a number of Doubles from this iterator.ByteIterator.ByteArrayIterator
getFloats(float[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Get a number of Floats from this iterator.ByteIterator.ByteArrayIterator
getInts(int[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Get a number of Ints from this iterator.ByteIterator.ByteArrayIterator
getLongs(long[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Get a number of Longs from this iterator.ByteIterator.ByteArrayIterator
getShorts(short[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Get a number of Shorts from this iterator.boolean
hasNext()
byte
head()
int
len()
byte
next()
int
size()
ByteIterator.ByteArrayIterator
take(int n)
ByteIterator.ByteArrayIterator
takeWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
ByteString
toByteString()
int
until()
-
Methods inherited from class akka.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, toSeq
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods 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, toVector
-
Methods 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
-
-
-
-
Method Detail
-
array
public byte[] array()
-
from
public int from()
-
until
public int until()
-
len
public final int len()
- Specified by:
len
in classByteIterator
-
hasNext
public final boolean hasNext()
-
head
public final byte head()
- Specified by:
head
in interfacescala.collection.BufferedIterator<java.lang.Object>
- Specified by:
head
in classByteIterator
-
next
public final byte next()
- Specified by:
next
in interfacescala.collection.Iterator<java.lang.Object>
- Specified by:
next
in classByteIterator
-
clear
public void clear()
- Specified by:
clear
in classByteIterator
-
size
public final int size()
-
$plus$plus
public final ByteIterator $plus$plus(scala.collection.IterableOnce<java.lang.Object> that)
- Overrides:
$plus$plus
in classByteIterator
-
clone
public final ByteIterator.ByteArrayIterator clone()
- Overrides:
clone
in classByteIterator
-
take
public final ByteIterator.ByteArrayIterator take(int n)
- Specified by:
take
in interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterator,scala.collection.Iterator<java.lang.Object>>
- Specified by:
take
in interfacescala.collection.Iterator<java.lang.Object>
- Overrides:
take
in classByteIterator
-
drop
public final ByteIterator.ByteArrayIterator drop(int n)
- Specified by:
drop
in interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterator,scala.collection.Iterator<java.lang.Object>>
- Specified by:
drop
in interfacescala.collection.Iterator<java.lang.Object>
- Overrides:
drop
in classByteIterator
-
takeWhile
public final ByteIterator.ByteArrayIterator takeWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
- Specified by:
takeWhile
in interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterator,scala.collection.Iterator<java.lang.Object>>
- Specified by:
takeWhile
in interfacescala.collection.Iterator<java.lang.Object>
- Overrides:
takeWhile
in classByteIterator
-
dropWhile
public final ByteIterator.ByteArrayIterator dropWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
- Specified by:
dropWhile
in interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterator,scala.collection.Iterator<java.lang.Object>>
- Specified by:
dropWhile
in interfacescala.collection.Iterator<java.lang.Object>
- Overrides:
dropWhile
in classByteIterator
-
copyToArray
public <B> int copyToArray(java.lang.Object xs, int start)
-
copyToArray
public <B> int copyToArray(java.lang.Object xs)
-
copyToArray
public final <B> int copyToArray(java.lang.Object xs, int start, int len)
-
toByteString
public final ByteString toByteString()
- Specified by:
toByteString
in classByteIterator
-
getBytes
public ByteIterator.ByteArrayIterator getBytes(byte[] xs, int offset, int n) throws java.util.NoSuchElementException
Description copied from class:ByteIterator
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.- Specified by:
getBytes
in classByteIterator
- Throws:
java.util.NoSuchElementException
-
getShorts
public ByteIterator.ByteArrayIterator getShorts(short[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Description copied from class:ByteIterator
Get a number of Shorts from this iterator.- Specified by:
getShorts
in classByteIterator
-
getInts
public ByteIterator.ByteArrayIterator getInts(int[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Description copied from class:ByteIterator
Get a number of Ints from this iterator.- Specified by:
getInts
in classByteIterator
-
getLongs
public ByteIterator.ByteArrayIterator getLongs(long[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Description copied from class:ByteIterator
Get a number of Longs from this iterator.- Specified by:
getLongs
in classByteIterator
-
getFloats
public ByteIterator.ByteArrayIterator getFloats(float[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Description copied from class:ByteIterator
Get a number of Floats from this iterator.- Specified by:
getFloats
in classByteIterator
-
getDoubles
public ByteIterator.ByteArrayIterator getDoubles(double[] xs, int offset, int n, java.nio.ByteOrder byteOrder)
Description copied from class:ByteIterator
Get a number of Doubles from this iterator.- Specified by:
getDoubles
in classByteIterator
-
copyToBuffer
public int copyToBuffer(java.nio.ByteBuffer buffer)
Description copied from class:ByteIterator
For performance sensitive code, call take() directly on ByteString (it's optimised there)- Specified by:
copyToBuffer
in classByteIterator
-
asInputStream
public java.io.InputStream asInputStream()
Description copied from class:ByteIterator
Directly wraps this ByteIterator in an InputStream without copying. Read and skip operations on the stream will advance the iterator accordingly.- Specified by:
asInputStream
in classByteIterator
-
-