Package akka.util

Class CompactByteString

  • 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.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.ByteString1C

    public abstract class CompactByteString
    extends ByteString
    implements java.io.Serializable
    A compact ByteString.

    The ByteString is guarantied to be contiguous in memory and to use only as much memory as required for its contents.

    See Also:
    Serialized Form
    • Nested Class Summary

      • 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>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CompactByteString apply​(byte[] bytes)
      Creates a new CompactByteString by copying a byte array.
      static CompactByteString apply​(<any> bytes)
      Creates a new CompactByteString by traversing bytes.
      static CompactByteString apply​(java.lang.String string, java.lang.String charset)
      Creates a new CompactByteString by encoding a String with a charset.
      static CompactByteString apply​(java.lang.String string, java.nio.charset.Charset charset)
      Creates a new CompactByteString by encoding a String with a charset.
      static CompactByteString apply​(scala.collection.immutable.Seq<java.lang.Object> bytes)
      Creates a new CompactByteString by copying bytes.
      static <T> CompactByteString apply​(scala.collection.immutable.Seq<T> bytes, scala.math.Integral<T> num)
      Creates a new CompactByteString by converting from integral numbers to bytes.
      CompactByteString compact()
      Create a new ByteString with all contents compacted into a single, full byte array.
      static CompactByteString empty()  
      static CompactByteString fromArray​(byte[] array, int offset, int length)
      Creates a new CompactByteString by copying length bytes starting at offset from an Array.
      boolean isCompact()
      Check whether this ByteString is compact in memory.
      • 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, newBuilder, transpose, unzip, unzip3
      • Methods inherited from interface scala.collection.GenSeqLike

        equals, indexOf, indexWhere, 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, sizeHintIfCheap, thisCollection, toBuffer, toCollection
      • Methods inherited from interface scala.collection.IterableLike

        canEqual, exists, find, foldRight, forall, reduceRight, sameElements, sliding, sliding, toIterable, toIterator, toStream, zip, zipAll, zipWithIndex
      • 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, endsWith, indexOfSlice, indexOfSlice, indices, intersect, isEmpty, lastIndexOfSlice, lastIndexOfSlice, lastIndexWhere, length, lengthCompare, padTo, parCombiner, patch, permutations, reverse, reverseIterator, reverseMap, segmentLength, size, sortBy, sorted, sortWith, startsWith, 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, newBuilder, partition, repr, scan, scanLeft, scanRight, sliceWithKnownBound, sliceWithKnownDelta, stringPrefix, tails, to, toTraversable, withFilter
      • Methods inherited from interface scala.collection.TraversableOnce

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

      • CompactByteString

        public CompactByteString()
    • Method Detail

      • apply

        public static CompactByteString apply​(byte[] bytes)
        Creates a new CompactByteString by copying a byte array.
      • apply

        public static CompactByteString apply​(scala.collection.immutable.Seq<java.lang.Object> bytes)
        Creates a new CompactByteString by copying bytes.
      • apply

        public static CompactByteString apply​(<any> bytes)
        Creates a new CompactByteString by traversing bytes.
      • apply

        public static <T> CompactByteString apply​(scala.collection.immutable.Seq<T> bytes,
                                                  scala.math.Integral<T> num)
        Creates a new CompactByteString by converting from integral numbers to bytes.
      • apply

        public static CompactByteString apply​(java.lang.String string,
                                              java.lang.String charset)
        Creates a new CompactByteString by encoding a String with a charset.
      • apply

        public static CompactByteString apply​(java.lang.String string,
                                              java.nio.charset.Charset charset)
        Creates a new CompactByteString by encoding a String with a charset.
      • fromArray

        public static CompactByteString fromArray​(byte[] array,
                                                  int offset,
                                                  int length)
        Creates a new CompactByteString by copying length bytes starting at offset from an Array.
      • 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
      • 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