akka.util
Class ByteIterator.ByteArrayIterator

java.lang.Object
  extended by akka.util.ByteIterator
      extended by akka.util.ByteIterator.ByteArrayIterator
All Implemented Interfaces:
scala.collection.BufferedIterator<java.lang.Object>, scala.collection.GenTraversableOnce<java.lang.Object>, scala.collection.Iterator<java.lang.Object>, scala.collection.TraversableOnce<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$
 
Nested classes/interfaces inherited from interface scala.collection.Iterator
scala.collection.Iterator.ConcatIterator<A>, scala.collection.Iterator.GroupedIterator<B>, scala.collection.Iterator.JoinIterator<A>
 
Nested classes/interfaces inherited from interface scala.collection.TraversableOnce
scala.collection.TraversableOnce.BufferedCanBuildFrom<A,CC extends scala.collection.TraversableOnce<java.lang.Object>>, scala.collection.TraversableOnce.FlattenOps<A>, scala.collection.TraversableOnce.ForceImplicitAmbiguity, scala.collection.TraversableOnce.MonadOps<A>, scala.collection.TraversableOnce.OnceCanBuildFrom<A>
 
Method Summary
 java.io.InputStream asInputStream()
          Directly wraps this ByteIterator in an InputStream without copying.
 void clear()
           
 ByteIterator.ByteArrayIterator clone()
           
<B> void
copyToArray(java.lang.Object xs, int start, int len)
           
 int copyToBuffer(java.nio.ByteBuffer buffer)
          Copy as many bytes as possible to a ByteBuffer, starting from it's current position.
 ByteIterator.ByteArrayIterator drop(int n)
           
 ByteIterator.ByteArrayIterator dropWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
           
 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()
           
 int length()
           
 byte next()
           
 ByteIterator.ByteArrayIterator take(int n)
           
 ByteIterator.ByteArrayIterator takeWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
           
 ByteString toByteString()
           
 
Methods inherited from class akka.util.ByteIterator
duplicate, foldLeft, foreach, getByte, getBytes, getDouble, getDoubles, getFloat, getFloats, getInt, getInts, getLong, getLongPart, getLongs, getShort, getShorts, indexOf, indexOf, indexWhere, 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.BufferedIterator
buffered
 
Methods inherited from interface scala.collection.Iterator
$plus$plus, collect, contains, corresponds, exists, filter, filterNot, find, flatMap, forall, grouped, hasDefiniteSize, isEmpty, isTraversableAgain, map, padTo, partition, patch, sameElements, scanLeft, scanRight, seq, sliding, sliding$default$2, toIterator, toStream, toString, toTraversable, withFilter, zip, zipAll, zipWithIndex
 
Methods inherited from interface scala.collection.TraversableOnce
$colon$bslash, $div$colon, addString, addString, addString, aggregate, collectFirst, copyToArray, copyToArray, copyToBuffer, count, fold, foldRight, max, maxBy, min, minBy, mkString, mkString, mkString, nonEmpty, product, reduce, reduceLeft, reduceLeftOption, reduceOption, reduceRight, reduceRightOption, reversed, size, sum, to, toBuffer, toIndexedSeq, toIterable, toList, toMap, toSet, toVector
 

Method Detail

len

public final int len()
Specified by:
len in class ByteIterator

hasNext

public final boolean hasNext()

head

public final byte head()
Specified by:
head in interface scala.collection.BufferedIterator<java.lang.Object>
Specified by:
head in class ByteIterator

next

public final byte next()
Specified by:
next in interface scala.collection.Iterator<java.lang.Object>
Specified by:
next in class ByteIterator

clear

public void clear()
Specified by:
clear in class ByteIterator

length

public final int length()

clone

public final ByteIterator.ByteArrayIterator clone()
Overrides:
clone in class ByteIterator

take

public final ByteIterator.ByteArrayIterator take(int n)
Specified by:
take in interface scala.collection.Iterator<java.lang.Object>
Overrides:
take in class ByteIterator

drop

public final ByteIterator.ByteArrayIterator drop(int n)
Specified by:
drop in interface scala.collection.Iterator<java.lang.Object>
Overrides:
drop in class ByteIterator

takeWhile

public final ByteIterator.ByteArrayIterator takeWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
Specified by:
takeWhile in interface scala.collection.Iterator<java.lang.Object>
Overrides:
takeWhile in class ByteIterator

dropWhile

public final ByteIterator.ByteArrayIterator dropWhile(scala.Function1<java.lang.Object,java.lang.Object> p)
Specified by:
dropWhile in interface scala.collection.Iterator<java.lang.Object>
Overrides:
dropWhile in class ByteIterator

copyToArray

public final <B> void copyToArray(java.lang.Object xs,
                                  int start,
                                  int len)

toByteString

public final ByteString toByteString()
Specified by:
toByteString in class ByteIterator

getBytes

public ByteIterator.ByteArrayIterator getBytes(byte[] xs,
                                               int offset,
                                               int n)
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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
Returns:
(undocumented)

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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
byteOrder - (undocumented)
Returns:
(undocumented)

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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
byteOrder - (undocumented)
Returns:
(undocumented)

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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
byteOrder - (undocumented)
Returns:
(undocumented)

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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
byteOrder - (undocumented)
Returns:
(undocumented)

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 class ByteIterator
Parameters:
xs - (undocumented)
offset - (undocumented)
n - (undocumented)
byteOrder - (undocumented)
Returns:
(undocumented)

copyToBuffer

public int copyToBuffer(java.nio.ByteBuffer buffer)
Description copied from class: ByteIterator
Copy as many bytes as possible to a ByteBuffer, starting from it's current position. This method will not overflow the buffer.

Specified by:
copyToBuffer in class ByteIterator
Parameters:
buffer - a ByteBuffer to copy bytes to
Returns:
the number of bytes actually copied

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 class ByteIterator
Returns:
(undocumented)