Package akka.util

Class ByteString.ByteString1

  • All Implemented Interfaces:
    java.io.Serializable, scala.collection.generic.FilterMonadic<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>, scala.collection.generic.GenericTraversableTemplate<java.lang.Object,​scala.collection.GenTraversable>, scala.collection.generic.HasNewBuilder<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>, scala.collection.GenIterable<java.lang.Object>, scala.collection.GenIterableLike<java.lang.Object,​scala.collection.GenIterable<java.lang.Object>>, scala.collection.GenSeq<java.lang.Object>, scala.collection.GenSeqLike<java.lang.Object,​scala.collection.GenSeq<java.lang.Object>>, scala.collection.GenTraversable<java.lang.Object>, scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>, scala.collection.GenTraversableOnce<java.lang.Object>, scala.collection.immutable.IndexedSeq<java.lang.Object>, scala.collection.immutable.Iterable<java.lang.Object>, scala.collection.immutable.Seq<java.lang.Object>, scala.collection.immutable.Traversable<java.lang.Object>, scala.collection.IndexedSeq<java.lang.Object>, scala.collection.IndexedSeqLike<java.lang.Object,​scala.collection.IndexedSeq<java.lang.Object>>, scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>, scala.collection.Iterable<java.lang.Object>, scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>, scala.collection.Parallelizable<java.lang.Object,​scala.collection.parallel.ParIterable<java.lang.Object>>, scala.collection.Seq<java.lang.Object>, scala.collection.SeqLike<java.lang.Object,​scala.collection.Seq<java.lang.Object>>, scala.collection.Traversable<java.lang.Object>, scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>, scala.collection.TraversableOnce<java.lang.Object>, scala.Equals, scala.Function1<java.lang.Object,​java.lang.Object>, scala.Immutable, scala.PartialFunction<java.lang.Object,​java.lang.Object>, scala.Serializable
    Enclosing class:
    ByteString

    public static final class ByteString.ByteString1
    extends ByteString
    implements scala.Serializable
    An unfragmented ByteString.
    See Also:
    Serialized Form
    • Method Detail

      • apply

        public byte apply​(int idx)
        Specified by:
        apply in interface scala.collection.GenSeqLike<java.lang.Object,​scala.collection.GenSeq<java.lang.Object>>
        Specified by:
        apply in interface scala.collection.SeqLike<java.lang.Object,​scala.collection.Seq<java.lang.Object>>
        Specified by:
        apply in class ByteString
      • iterator

        public ByteIterator.ByteArrayIterator iterator()
        Specified by:
        iterator in interface scala.collection.GenIterableLike<java.lang.Object,​scala.collection.GenIterable<java.lang.Object>>
        Specified by:
        iterator in interface scala.collection.IndexedSeqLike<java.lang.Object,​scala.collection.IndexedSeq<java.lang.Object>>
        Specified by:
        iterator in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Overrides:
        iterator in class ByteString
      • writeToOutputStream

        public void writeToOutputStream​(java.io.ObjectOutputStream os)
        Specified by:
        writeToOutputStream in class ByteString
      • isCompact

        public boolean isCompact()
        Description copied from class: ByteString
        Check whether this ByteString is compact in memory. If the ByteString is compact, it might, however, not be represented by an object that takes full advantage of that fact. Use compact to get such an object.
        Specified by:
        isCompact in class ByteString
        Returns:
        (undocumented)
      • dropRight

        public ByteString dropRight​(int n)
        Specified by:
        dropRight in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        dropRight in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Overrides:
        dropRight in class ByteString
      • drop

        public ByteString drop​(int n)
        Specified by:
        drop in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        drop in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        drop in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        drop in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Overrides:
        drop in class ByteString
      • take

        public ByteString take​(int n)
        Specified by:
        take in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        take in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        take in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        take in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Overrides:
        take in class ByteString
      • slice

        public ByteString slice​(int from,
                                int until)
        Specified by:
        slice in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        slice in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        slice in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        slice in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Overrides:
        slice in class ByteString
      • copyToBuffer

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

        Overrides:
        copyToBuffer in class ByteString
        Parameters:
        buffer - a ByteBuffer to copy bytes to
        Returns:
        the number of bytes actually copied
      • writeToBuffer

        public int writeToBuffer​(java.nio.ByteBuffer buffer)
        INTERNAL API: Specialized for internal use, writing multiple ByteString1C into the same ByteBuffer.
      • compact

        public CompactByteString compact()
        Description copied from class: ByteString
        Create a new ByteString with all contents compacted into a single, full byte array. If isCompact returns true, compact is an O(1) operation, but might return a different object with an optimized implementation.
        Specified by:
        compact in class ByteString
        Returns:
        (undocumented)
      • asByteBuffer

        public java.nio.ByteBuffer asByteBuffer()
        Description copied from class: ByteString
        Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.
        Specified by:
        asByteBuffer in class ByteString
        Returns:
        (undocumented)
      • asByteBuffers

        public scala.collection.immutable.Iterable<java.nio.ByteBuffer> asByteBuffers()
        Description copied from class: ByteString
        Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.
        Specified by:
        asByteBuffers in class ByteString
        Returns:
        (undocumented)
      • decodeString

        public java.lang.String decodeString​(java.lang.String charset)
        Description copied from class: ByteString
        Decodes this ByteString using a charset to produce a String. If you have a Charset instance available, use decodeString(charset: java.nio.charset.Charset instead.
        Specified by:
        decodeString in class ByteString
        Parameters:
        charset - (undocumented)
        Returns:
        (undocumented)
      • decodeString

        public java.lang.String decodeString​(java.nio.charset.Charset charset)
        Description copied from class: ByteString
        Decodes this ByteString using a charset to produce a String. Avoids Charset.forName lookup in String internals, thus is preferable to decodeString(charset: String).
        Specified by:
        decodeString in class ByteString
        Parameters:
        charset - (undocumented)
        Returns:
        (undocumented)
      • $plus$plus

        public ByteString $plus$plus​(ByteString that)
        Description copied from class: ByteString
        Efficiently concatenate another ByteString.
        Specified by:
        $plus$plus in class ByteString
        Parameters:
        that - (undocumented)
        Returns:
        (undocumented)
      • indexOf

        public <B> int indexOf​(B elem)
        Specified by:
        indexOf in interface scala.collection.GenSeqLike<java.lang.Object,​scala.collection.GenSeq<java.lang.Object>>
        Overrides:
        indexOf in class ByteString
      • indexOf

        public <B> int indexOf​(B elem,
                               int from)
        Specified by:
        indexOf in interface scala.collection.GenSeqLike<java.lang.Object,​scala.collection.GenSeq<java.lang.Object>>
      • writeReplace

        protected java.lang.Object writeReplace()