Package akka.util

Class ByteString

  • All Implemented Interfaces:
    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>
    Direct Known Subclasses:
    ByteString.ByteString1, ByteString.ByteStrings, CompactByteString

    public abstract class ByteString
    extends java.lang.Object
    implements scala.collection.immutable.IndexedSeq<java.lang.Object>, scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
    Java API: copy this ByteString into a fresh byte array

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ByteString.ByteString1  
      static class  ByteString.ByteString1$  
      static class  ByteString.ByteString1C  
      static class  ByteString.ByteString1C$  
      static class  ByteString.ByteStrings  
      static class  ByteString.ByteStrings$  
      static interface  ByteString.Companion  
      static class  ByteString.Companion$  
      • Nested classes/interfaces inherited from interface scala.collection.immutable.IndexedSeq

        scala.collection.immutable.IndexedSeq.Impl<A extends java.lang.Object>
      • Nested classes/interfaces inherited from interface scala.collection.IndexedSeqLike

        scala.collection.IndexedSeqLike.Elements
      • Nested classes/interfaces inherited from interface scala.PartialFunction

        scala.PartialFunction.AndThen<A extends java.lang.Object,​B extends java.lang.Object,​C extends java.lang.Object>, scala.PartialFunction.Lifted<A extends java.lang.Object,​B extends java.lang.Object>, scala.PartialFunction.OrElse<A extends java.lang.Object,​B extends java.lang.Object>, scala.PartialFunction.Unlifted<A extends java.lang.Object,​B extends java.lang.Object>
      • Nested classes/interfaces inherited from interface scala.collection.SeqLike

        scala.collection.SeqLike.CombinationsItr, scala.collection.SeqLike.PermutationsItr
      • Nested classes/interfaces inherited from interface scala.collection.TraversableLike

        scala.collection.TraversableLike.WithFilter
      • Nested classes/interfaces inherited from interface scala.collection.TraversableOnce

        scala.collection.TraversableOnce.BufferedCanBuildFrom<A extends java.lang.Object,​CC extends scala.collection.TraversableOnce<java.lang.Object>>, scala.collection.TraversableOnce.FlattenOps<A extends java.lang.Object>, scala.collection.TraversableOnce.ForceImplicitAmbiguity, scala.collection.TraversableOnce.MonadOps<A extends java.lang.Object>, scala.collection.TraversableOnce.OnceCanBuildFrom<A extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteString()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract ByteString $plus$plus​(ByteString that)
      Efficiently concatenate another ByteString.
      abstract byte apply​(int idx)  
      abstract java.nio.ByteBuffer asByteBuffer()
      Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.
      abstract scala.collection.immutable.Iterable<java.nio.ByteBuffer> asByteBuffers()
      Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments.
      abstract ByteString.Companion byteStringCompanion()  
      static scala.collection.generic.CanBuildFrom<scala.collection.TraversableOnce<java.lang.Object>,​java.lang.Object,​ByteString> canBuildFrom()  
      abstract CompactByteString compact()
      Create a new ByteString with all contents compacted into a single, full byte array.
      ByteString concat​(ByteString that)
      Java API: efficiently concatenate another ByteString.
      <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.
      static ByteStringBuilder createBuilder()
      Java API
      abstract java.lang.String decodeString​(java.lang.String charset)
      Decodes this ByteString using a charset to produce a String.
      abstract java.lang.String decodeString​(java.nio.charset.Charset charset)
      Decodes this ByteString using a charset to produce a String.
      ByteString drop​(int n)  
      ByteString dropRight​(int n)  
      ByteString dropWhile​(scala.Function1<java.lang.Object,​java.lang.Object> p)  
      static ByteString empty()  
      static ByteString emptyByteString()
      Java API
      <U> void foreach​(scala.Function1<java.lang.Object,​U> f)  
      void foreach$mBc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mCc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mDc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mFc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mIc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mJc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mSc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      void foreach$mVc$sp​(scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> f)  
      void foreach$mZc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)  
      static ByteString fromArray​(byte[] array)
      Creates a new ByteString by copying a byte array.
      static ByteString fromArray​(byte[] array, int offset, int length)
      Creates a new ByteString by copying length bytes starting at offset from an Array.
      static ByteString fromArrayUnsafe​(byte[] array)
      Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.
      static ByteString fromArrayUnsafe​(byte[] array, int offset, int length)
      Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.
      static ByteString fromByteBuffer​(java.nio.ByteBuffer buffer)
      Creates a new ByteString by copying bytes out of a ByteBuffer.
      static ByteString fromInts​(int... array)  
      static ByteString fromInts​(scala.collection.Seq<java.lang.Object> array)
      JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.
      static ByteString fromString​(java.lang.String string)
      Creates a new ByteString which will contain the UTF-8 representation of the given String
      static ByteString fromString​(java.lang.String string, java.lang.String charset)
      Creates a new ByteString which will contain the representation of the given String in the given charset
      static ByteString fromString​(java.lang.String string, java.nio.charset.Charset charset)
      Creates a new ByteString which will contain the representation of the given String in the given charset
      java.lang.Iterable<java.nio.ByteBuffer> getByteBuffers()
      Java API: Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments.
      scala.collection.Iterator<ByteString> grouped​(int size)  
      byte head()  
      <B> int indexOf​(B elem)  
      int indexWhere​(scala.Function1<java.lang.Object,​java.lang.Object> p)  
      ByteString init()  
      abstract boolean isCompact()
      Check whether this ByteString is compact in memory.
      ByteIterator iterator()  
      byte last()  
      ByteString mapI​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      map method that will automatically cast Int back into Byte.
      protected ByteStringBuilder newBuilder()  
      ByteString slice​(int from, int until)  
      scala.Tuple2<ByteString,​ByteString> span​(scala.Function1<java.lang.Object,​java.lang.Object> p)  
      scala.Tuple2<ByteString,​ByteString> splitAt​(int n)  
      java.lang.String stringPrefix()  
      ByteString tail()  
      ByteString take​(int n)  
      ByteString takeRight​(int n)  
      ByteString takeWhile​(scala.Function1<java.lang.Object,​java.lang.Object> p)  
      protected byte[] toArray()
      Java API: copy this ByteString into a fresh byte array
      <B> java.lang.Object toArray​(scala.reflect.ClassTag<B> arg0)  
      java.nio.ByteBuffer toByteBuffer()
      Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.
      java.lang.String toString()  
      static java.lang.String UTF_8()
      Standard "UTF-8" charset
      java.lang.String utf8String()
      Decodes this ByteString as a UTF-8 encoded String.
      abstract void writeToOutputStream​(java.io.ObjectOutputStream os)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface scala.Function1

        apply, apply$mcDD$sp, apply$mcDF$sp, apply$mcDI$sp, apply$mcDJ$sp, apply$mcFD$sp, apply$mcFF$sp, apply$mcFI$sp, apply$mcFJ$sp, apply$mcID$sp, apply$mcIF$sp, apply$mcII$sp, apply$mcIJ$sp, apply$mcJD$sp, apply$mcJF$sp, apply$mcJI$sp, apply$mcJJ$sp, apply$mcVD$sp, apply$mcVF$sp, apply$mcVI$sp, apply$mcVJ$sp, apply$mcZD$sp, apply$mcZF$sp, apply$mcZI$sp, apply$mcZJ$sp, compose
      • Methods inherited from interface scala.collection.generic.GenericTraversableTemplate

        flatten, genericBuilder, isEmpty, transpose, unzip, unzip3
      • Methods inherited from interface scala.collection.GenSeqLike

        equals, indexOf, isDefinedAt, lastIndexOf, lastIndexOf, lastIndexWhere, prefixLength, startsWith
      • Methods inherited from interface scala.collection.GenTraversableLike

        flatMap, map, size
      • Methods inherited from interface scala.collection.immutable.IndexedSeq

        companion, seq, toIndexedSeq
      • Methods inherited from interface scala.collection.IndexedSeqLike

        hashCode, seq, sizeHintIfCheap, thisCollection, toBuffer, toCollection
      • Methods inherited from interface scala.collection.IndexedSeqOptimized

        endsWith, exists, find, foldLeft, foldRight, forall, indexWhere, isEmpty, lastIndexWhere, lengthCompare, reduceLeft, reduceRight, reverse, reverseIterator, sameElements, segmentLength, startsWith, toList, zip, zipWithIndex
      • Methods inherited from interface scala.collection.IterableLike

        canEqual, sliding, sliding, toIterable, toIterator, toStream, zipAll
      • Methods inherited from interface scala.collection.Parallelizable

        par
      • Methods inherited from interface scala.PartialFunction

        andThen, applyOrElse, isDefinedAt, lift, orElse, runWith
      • Methods inherited from interface scala.collection.immutable.Seq

        parCombiner, toSeq
      • Methods inherited from interface scala.collection.SeqLike

        $colon$plus, $plus$colon, combinations, contains, containsSlice, corresponds, diff, distinct, indexOfSlice, indexOfSlice, indices, intersect, lastIndexOfSlice, lastIndexOfSlice, length, padTo, parCombiner, patch, permutations, reverseMap, size, sortBy, sorted, sortWith, toSeq, union, updated, view, view
      • Methods inherited from interface scala.collection.TraversableLike

        $plus$plus, $plus$plus$colon, $plus$plus$colon, collect, filter, filterImpl, filterNot, flatMap, groupBy, hasDefiniteSize, headOption, inits, isTraversableAgain, lastOption, map, partition, repr, scan, scanLeft, scanRight, sliceWithKnownBound, sliceWithKnownDelta, tails, to, toTraversable, withFilter
      • Methods inherited from interface scala.collection.TraversableOnce

        $colon$bslash, $div$colon, addString, addString, addString, aggregate, collectFirst, copyToArray, copyToArray, copyToBuffer, count, fold, max, maxBy, min, minBy, mkString, mkString, mkString, nonEmpty, product, reduce, reduceLeftOption, reduceOption, reduceRightOption, reversed, sum, toMap, toSet, toVector
    • Constructor Detail

      • ByteString

        public ByteString()
    • Method Detail

      • fromInts

        public static ByteString fromInts​(int... array)
      • fromArray

        public static ByteString fromArray​(byte[] array)
        Creates a new ByteString by copying a byte array.
        Parameters:
        array - (undocumented)
        Returns:
        (undocumented)
      • fromArrayUnsafe

        public static ByteString fromArrayUnsafe​(byte[] array)
        Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.

        Creates a ByteString without copying the passed in byte array, unlike other factory methods defined on ByteString. This method of creating a ByteString saves one array copy and allocation and therefore can lead to better performance, however it also means that one MUST NOT modify the passed in array, or unexpected immutable data structure contract-breaking behavior will manifest itself.

        This API is intended for users who have obtained an byte array from some other API, and want wrap it into an ByteArray, and from there on only use that reference (the ByteString) to operate on the wrapped data. For all other intents and purposes, please use the usual apply and create methods - which provide the immutability guarantees by copying the array.

        Parameters:
        array - (undocumented)
        Returns:
        (undocumented)
      • fromArray

        public static ByteString fromArray​(byte[] array,
                                           int offset,
                                           int length)
        Creates a new ByteString by copying length bytes starting at offset from an Array.
        Parameters:
        array - (undocumented)
        offset - (undocumented)
        length - (undocumented)
        Returns:
        (undocumented)
      • fromArrayUnsafe

        public static ByteString fromArrayUnsafe​(byte[] array,
                                                 int offset,
                                                 int length)
        Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.

        Creates a ByteString without copying the passed in byte array, unlike other factory methods defined on ByteString. This method of creating a ByteString saves one array copy and allocation and therefore can lead to better performance, however it also means that one MUST NOT modify the passed in array, or unexpected immutable data structure contract-breaking behavior will manifest itself.

        This API is intended for users who have obtained an byte array from some other API, and want wrap it into an ByteArray, and from there on only use that reference (the ByteString) to operate on the wrapped data. For all other intents and purposes, please use the usual apply and create methods - which provide the immutability guarantees by copying the array.

        Parameters:
        array - (undocumented)
        offset - (undocumented)
        length - (undocumented)
        Returns:
        (undocumented)
      • fromInts

        public static ByteString fromInts​(scala.collection.Seq<java.lang.Object> array)
        JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.
        Parameters:
        array - (undocumented)
        Returns:
        (undocumented)
      • fromString

        public static ByteString fromString​(java.lang.String string)
        Creates a new ByteString which will contain the UTF-8 representation of the given String
        Parameters:
        string - (undocumented)
        Returns:
        (undocumented)
      • fromString

        public static ByteString fromString​(java.lang.String string,
                                            java.lang.String charset)
        Creates a new ByteString which will contain the representation of the given String in the given charset
        Parameters:
        string - (undocumented)
        charset - (undocumented)
        Returns:
        (undocumented)
      • fromString

        public static ByteString fromString​(java.lang.String string,
                                            java.nio.charset.Charset charset)
        Creates a new ByteString which will contain the representation of the given String in the given charset
        Parameters:
        string - (undocumented)
        charset - (undocumented)
        Returns:
        (undocumented)
      • UTF_8

        public static java.lang.String UTF_8()
        Standard "UTF-8" charset
        Returns:
        (undocumented)
      • fromByteBuffer

        public static ByteString fromByteBuffer​(java.nio.ByteBuffer buffer)
        Creates a new ByteString by copying bytes out of a ByteBuffer.
        Parameters:
        buffer - (undocumented)
        Returns:
        (undocumented)
      • emptyByteString

        public static ByteString emptyByteString()
        Java API
      • canBuildFrom

        public static scala.collection.generic.CanBuildFrom<scala.collection.TraversableOnce<java.lang.Object>,​java.lang.Object,​ByteString> canBuildFrom()
      • apply

        public abstract 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>>
      • stringPrefix

        public final java.lang.String stringPrefix()
        Specified by:
        stringPrefix in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        stringPrefix in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • newBuilder

        protected ByteStringBuilder newBuilder()
        Specified by:
        newBuilder in interface scala.collection.generic.GenericTraversableTemplate<java.lang.Object,​scala.collection.GenTraversable>
        Specified by:
        newBuilder in interface scala.collection.generic.HasNewBuilder<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        newBuilder in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • iterator

        public ByteIterator 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>>
      • head

        public byte head()
        Specified by:
        head in interface scala.collection.generic.GenericTraversableTemplate<java.lang.Object,​scala.collection.GenTraversable>
        Specified by:
        head in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        head in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        head in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        head in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • tail

        public ByteString tail()
        Specified by:
        tail in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        tail in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        tail in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • last

        public byte last()
        Specified by:
        last in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        last in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        last in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • init

        public ByteString init()
        Specified by:
        init in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        init in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        init in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • 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>>
      • takeRight

        public ByteString takeRight​(int n)
        Specified by:
        takeRight in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        takeRight in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
      • 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>>
      • 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>>
      • 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>>
      • takeWhile

        public ByteString takeWhile​(scala.Function1<java.lang.Object,​java.lang.Object> p)
        Specified by:
        takeWhile in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        takeWhile in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        takeWhile in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        takeWhile in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • dropWhile

        public ByteString dropWhile​(scala.Function1<java.lang.Object,​java.lang.Object> p)
        Specified by:
        dropWhile in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        dropWhile in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        dropWhile in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • span

        public scala.Tuple2<ByteString,​ByteString> span​(scala.Function1<java.lang.Object,​java.lang.Object> p)
        Specified by:
        span in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        span in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        span in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • splitAt

        public scala.Tuple2<ByteString,​ByteString> splitAt​(int n)
        Specified by:
        splitAt in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        splitAt in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        splitAt in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
      • indexWhere

        public int indexWhere​(scala.Function1<java.lang.Object,​java.lang.Object> p)
        Specified by:
        indexWhere in interface scala.collection.GenSeqLike<java.lang.Object,​scala.collection.GenSeq<java.lang.Object>>
      • indexOf

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

        public scala.collection.Iterator<ByteString> grouped​(int size)
        Specified by:
        grouped in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface scala.Function1<java.lang.Object,​java.lang.Object>
        Specified by:
        toString in interface scala.collection.SeqLike<java.lang.Object,​scala.collection.Seq<java.lang.Object>>
        Specified by:
        toString in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Overrides:
        toString in class java.lang.Object
      • toArray

        protected byte[] toArray()
        Java API: copy this ByteString into a fresh byte array

        Returns:
        this ByteString copied into a byte array
      • toArray

        public <B> java.lang.Object toArray​(scala.reflect.ClassTag<B> arg0)
        Specified by:
        toArray in interface scala.collection.GenTraversableOnce<java.lang.Object>
        Specified by:
        toArray in interface scala.collection.TraversableOnce<java.lang.Object>
      • copyToArray

        public <B> void copyToArray​(java.lang.Object xs,
                                    int start,
                                    int len)
        Specified by:
        copyToArray in interface scala.collection.GenTraversableOnce<java.lang.Object>
        Specified by:
        copyToArray in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        copyToArray in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        copyToArray in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        copyToArray in interface scala.collection.TraversableOnce<java.lang.Object>
      • foreach

        public <U> void foreach​(scala.Function1<java.lang.Object,​U> f)
        Specified by:
        foreach in interface scala.collection.generic.FilterMonadic<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        foreach in interface scala.collection.generic.GenericTraversableTemplate<java.lang.Object,​scala.collection.GenTraversable>
        Specified by:
        foreach in interface scala.collection.GenTraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        foreach in interface scala.collection.GenTraversableOnce<java.lang.Object>
        Specified by:
        foreach in interface scala.collection.IndexedSeqOptimized<java.lang.Object,​ByteString>
        Specified by:
        foreach in interface scala.collection.IterableLike<java.lang.Object,​scala.collection.Iterable<java.lang.Object>>
        Specified by:
        foreach in interface scala.collection.TraversableLike<java.lang.Object,​scala.collection.Traversable<java.lang.Object>>
        Specified by:
        foreach in interface scala.collection.TraversableOnce<java.lang.Object>
      • writeToOutputStream

        public abstract void writeToOutputStream​(java.io.ObjectOutputStream os)
      • $plus$plus

        public abstract ByteString $plus$plus​(ByteString that)
        Efficiently concatenate another ByteString.
        Parameters:
        that - (undocumented)
        Returns:
        (undocumented)
      • concat

        public ByteString concat​(ByteString that)
        Java API: efficiently concatenate another ByteString.
        Parameters:
        that - (undocumented)
        Returns:
        (undocumented)
      • copyToBuffer

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

        Parameters:
        buffer - a ByteBuffer to copy bytes to
        Returns:
        the number of bytes actually copied
      • compact

        public abstract CompactByteString compact()
        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.
        Returns:
        (undocumented)
      • isCompact

        public abstract boolean isCompact()
        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.
        Returns:
        (undocumented)
      • asByteBuffer

        public abstract java.nio.ByteBuffer asByteBuffer()
        Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.
        Returns:
        (undocumented)
      • asByteBuffers

        public abstract scala.collection.immutable.Iterable<java.nio.ByteBuffer> asByteBuffers()
        Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.
        Returns:
        (undocumented)
      • getByteBuffers

        public java.lang.Iterable<java.nio.ByteBuffer> getByteBuffers()
        Java API: Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.
        Returns:
        (undocumented)
      • toByteBuffer

        public java.nio.ByteBuffer toByteBuffer()
        Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.
        Returns:
        (undocumented)
      • utf8String

        public final java.lang.String utf8String()
        Decodes this ByteString as a UTF-8 encoded String.
        Returns:
        (undocumented)
      • decodeString

        public abstract java.lang.String decodeString​(java.lang.String charset)
        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.
        Parameters:
        charset - (undocumented)
        Returns:
        (undocumented)
      • decodeString

        public abstract java.lang.String decodeString​(java.nio.charset.Charset charset)
        Decodes this ByteString using a charset to produce a String. Avoids Charset.forName lookup in String internals, thus is preferable to decodeString(charset: String).
        Parameters:
        charset - (undocumented)
        Returns:
        (undocumented)
      • mapI

        public final ByteString mapI​(scala.Function1<java.lang.Object,​java.lang.Object> f)
        map method that will automatically cast Int back into Byte.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • foreach$mZc$sp

        public void foreach$mZc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mBc$sp

        public void foreach$mBc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mCc$sp

        public void foreach$mCc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mDc$sp

        public void foreach$mDc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mFc$sp

        public void foreach$mFc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mIc$sp

        public void foreach$mIc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mJc$sp

        public void foreach$mJc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mSc$sp

        public void foreach$mSc$sp​(scala.Function1<java.lang.Object,​java.lang.Object> f)
      • foreach$mVc$sp

        public void foreach$mVc$sp​(scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> f)