Class ByteString
- java.lang.Object
- 
- akka.util.ByteString
 
- 
- All Implemented Interfaces:
- scala.collection.immutable.IndexedSeq<java.lang.Object>,- scala.collection.immutable.IndexedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,scala.collection.immutable.IndexedSeq<java.lang.Object>>,- scala.collection.immutable.Iterable<java.lang.Object>,- scala.collection.immutable.Seq<java.lang.Object>,- scala.collection.immutable.SeqOps<java.lang.Object,scala.collection.immutable.Seq,scala.collection.immutable.Seq<java.lang.Object>>,- scala.collection.immutable.StrictOptimizedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>,- scala.collection.IndexedSeq<java.lang.Object>,- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>,- scala.collection.Iterable<java.lang.Object>,- scala.collection.IterableFactoryDefaults<java.lang.Object,scala.collection.Iterable>,- scala.collection.IterableOnce<java.lang.Object>,- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>,- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>,- scala.collection.Seq<java.lang.Object>,- scala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>,- scala.collection.StrictOptimizedIterableOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>,- scala.collection.StrictOptimizedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>,- scala.Equals,- scala.Function1<java.lang.Object,java.lang.Object>,- 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.immutable.IndexedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>, scala.collection.immutable.StrictOptimizedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString> A rope-like immutable data structure containing bytes. The goal of this structure is to reduce copying of arrays when concatenating and slicing sequences of bytes, and also providing a thread safe way of working with bytes.TODO: Add performance characteristics 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classByteString.ByteString1An unfragmented ByteString.static classByteString.ByteString1$INTERNAL API: ByteString backed by exactly one array, with start / end markersstatic classByteString.ByteString1CA compact (unsliced) and unfragmented ByteString, implementation of ByteString1C.static classByteString.ByteString1C$static classByteString.ByteStringsA ByteString with 2 or more fragments.static classByteString.ByteStrings$static interfaceByteString.Companionstatic classByteString.Companion$- 
Nested classes/interfaces inherited from interface scala.Function1scala.Function1.UnliftOps<A extends java.lang.Object,B extends java.lang.Object>, scala.Function1.UnliftOps$
 
- 
 - 
Constructor SummaryConstructors Constructor Description ByteString()
 - 
Method SummaryAll 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 byteapply(int idx)abstract java.nio.ByteBufferasByteBuffer()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.java.lang.StringclassName()abstract CompactByteStringcompact()Create a new ByteString with all contents compacted into a single, full byte array.ByteStringconcat(ByteString that)Java API: efficiently concatenate another ByteString.<B> intcopyToArray(java.lang.Object xs, int start)<B> intcopyToArray(java.lang.Object xs, int start, int len)abstract intcopyToBuffer(java.nio.ByteBuffer buffer)Copy as many bytes as possible to a ByteBuffer, starting from it's current position.static ByteStringBuildercreateBuilder()Java APIabstract ByteStringdecodeBase64()abstract java.lang.StringdecodeString(java.lang.String charset)Decodes this ByteString using a charset to produce a String.abstract java.lang.StringdecodeString(java.nio.charset.Charset charset)Decodes this ByteString using a charset to produce a String.ByteStringdrop(int n)ByteStringdropRight(int n)ByteStringdropWhile(scala.Function1<java.lang.Object,java.lang.Object> p)ByteStringempty()static ByteStringemptyByteString()Java APIabstract ByteStringencodeBase64()Returns a ByteString which is the Base64 representation of this ByteString<U> voidforeach(scala.Function1<java.lang.Object,U> f)static ByteStringfromArray(byte[] array)Creates a new ByteString by copying a byte array.static ByteStringfromArray(byte[] array, int offset, int length)Creates a new ByteString by copying length bytes starting at offset from an Array.static ByteStringfromArrayUnsafe(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 ByteStringfromArrayUnsafe(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 ByteStringfromByteBuffer(java.nio.ByteBuffer buffer)Creates a new ByteString by copying bytes out of a ByteBuffer.static ByteStringfromInts(int... array)JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.static ByteStringfromInts(scala.collection.immutable.Seq<java.lang.Object> array)JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.protected ByteStringfromSpecific(scala.collection.IterableOnce<java.lang.Object> coll)static ByteStringfromString(java.lang.String string)Creates a new ByteString which will contain the UTF-8 representation of the given Stringstatic ByteStringfromString(java.lang.String string, java.lang.String charset)Creates a new ByteString which will contain the representation of the given String in the given charsetstatic ByteStringfromString(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 charsetjava.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)bytehead()<B> intindexOf(B elem, int from)intindexWhere(scala.Function1<java.lang.Object,java.lang.Object> p, int from)ByteStringinit()abstract booleanisCompact()Check whether this ByteString is compact in memory.booleanisEmpty()ByteIteratoriterator()bytelast()<A> ByteStringmap(scala.Function1<java.lang.Object,java.lang.Object> f)ByteStringmapI(scala.Function1<java.lang.Object,java.lang.Object> f)map method that will automatically cast Int back into Byte.static ByteStringBuildernewBuilder()protected scala.collection.mutable.Builder<java.lang.Object,ByteString>newSpecificBuilder()ByteStringslice(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)ByteStringtail()ByteStringtake(int n)ByteStringtakeRight(int n)ByteStringtakeWhile(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.ObjecttoArray(scala.reflect.ClassTag<B> arg0)byte[]toArrayUnsafe()Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.java.nio.ByteBuffertoByteBuffer()Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.java.lang.StringtoString()static java.lang.StringUTF_8()Standard "UTF-8" charsetjava.lang.Stringutf8String()Decodes this ByteString as a UTF-8 encoded String.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface scala.Function1apply, 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.immutable.IndexedSeqapplyPreferredMaxLength, canEqual, iterableFactory, sameElements, toIndexedSeq
 - 
Methods inherited from interface scala.collection.IndexedSeqOpsfoldRight, headOption, knownSize, lengthCompare, lengthCompare, map, prepended, reverse, reversed, reverseIterator, search, search, stepper, view, view
 - 
Methods inherited from interface scala.collection.Iterablecoll, collectionClassName, lazyZip, seq, toIterable
 - 
Methods inherited from interface scala.collection.IterableOnceOps$colon$bslash, $div$colon, addString, addString, addString, aggregate, collectFirst, copyToArray, copyToBuffer, corresponds, count, exists, find, fold, foldLeft, forall, hasDefiniteSize, max, maxBy, maxByOption, maxOption, min, minBy, minByOption, minOption, mkString, mkString, mkString, nonEmpty, product, reduce, reduceLeft, reduceLeftOption, reduceOption, reduceRight, reduceRightOption, sum, to, toBuffer, toIterator, toList, toMap, toSet, toStream, toVector
 - 
Methods inherited from interface scala.collection.IterableOps$plus$plus, companion, groupBy, groupMap, groupMapReduce, inits, isTraversableAgain, lastOption, repr, scan, scanRight, sizeIs, sliding, sliding, tails, toTraversable, transpose, withFilter, zipAll
 - 
Methods inherited from interface scala.PartialFunctionandThen, andThen, applyOrElse, compose, elementWise, isDefinedAt, lift, orElse, runWith, unapply
 - 
Methods inherited from interface scala.collection.SeqOps$colon$plus, $colon$plus$plus, $plus$colon, $plus$plus$colon, combinations, concat, contains, containsSlice, corresponds, distinct, endsWith, findLast, indexOf, indexOfSlice, indexOfSlice, indexWhere, indices, isDefinedAt, lastIndexOf, lastIndexOf$default$2, lastIndexOfSlice, lastIndexOfSlice, lastIndexWhere, lastIndexWhere, length, lengthIs, occCounts, permutations, prefixLength, reverseMap, scala$collection$SeqOps$$toGenericSeq, segmentLength, segmentLength, size, sizeCompare, sizeCompare, sortBy, sortWith, startsWith, startsWith$default$2, union
 - 
Methods inherited from interface scala.collection.StrictOptimizedIterableOpscollect, filter, filterImpl, filterNot, flatMap, flatten, map, partition, partitionMap, scanLeft, strictOptimizedCollect, strictOptimizedConcat, strictOptimizedFlatMap, strictOptimizedFlatten, strictOptimizedMap, strictOptimizedZip, tapEach, unzip, unzip3, zip, zipWithIndex
 
- 
 
- 
- 
- 
Method Detail- 
fromIntspublic static ByteString fromInts(int... array) JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.
 - 
fromArraypublic static ByteString fromArray(byte[] array) Creates a new ByteString by copying a byte array.
 - 
fromArrayUnsafepublic 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. 
 - 
fromArraypublic static ByteString fromArray(byte[] array, int offset, int length) Creates a new ByteString by copying length bytes starting at offset from an Array.
 - 
fromArrayUnsafepublic 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. 
 - 
fromIntspublic static ByteString fromInts(scala.collection.immutable.Seq<java.lang.Object> array) JAVA API Creates a new ByteString by copying an int array by converting from integral numbers to bytes.
 - 
fromStringpublic static ByteString fromString(java.lang.String string) Creates a new ByteString which will contain the UTF-8 representation of the given String
 - 
fromStringpublic 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
 - 
fromStringpublic 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
 - 
UTF_8public static java.lang.String UTF_8() Standard "UTF-8" charset
 - 
fromByteBufferpublic static ByteString fromByteBuffer(java.nio.ByteBuffer buffer) Creates a new ByteString by copying bytes out of a ByteBuffer.
 - 
emptyByteStringpublic static ByteString emptyByteString() Java API
 - 
newBuilderpublic static ByteStringBuilder newBuilder() 
 - 
createBuilderpublic static ByteStringBuilder createBuilder() Java API
 - 
fromSpecificprotected ByteString fromSpecific(scala.collection.IterableOnce<java.lang.Object> coll) - Specified by:
- fromSpecificin interface- scala.collection.IterableFactoryDefaults<java.lang.Object,scala.collection.Iterable>
- Specified by:
- fromSpecificin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
newSpecificBuilderprotected scala.collection.mutable.Builder<java.lang.Object,ByteString> newSpecificBuilder() - Specified by:
- newSpecificBuilderin interface- scala.collection.IterableFactoryDefaults<java.lang.Object,scala.collection.Iterable>
- Specified by:
- newSpecificBuilderin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
emptypublic ByteString empty() - Specified by:
- emptyin interface- scala.collection.IterableFactoryDefaults<java.lang.Object,scala.collection.Iterable>
- Specified by:
- emptyin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
applypublic abstract byte apply(int idx) - Specified by:
- applyin interface- scala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>
 
 - 
classNamepublic final java.lang.String className() - Specified by:
- classNamein interface- scala.collection.Iterable<java.lang.Object>
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- isEmptyin interface- scala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>
 
 - 
iteratorpublic ByteIterator iterator() - Specified by:
- iteratorin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- iteratorin interface- scala.collection.IterableOnce<java.lang.Object>
 
 - 
headpublic byte head() - Specified by:
- headin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- headin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
tailpublic ByteString tail() - Specified by:
- tailin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
lastpublic byte last() - Specified by:
- lastin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- lastin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
initpublic ByteString init() - Specified by:
- initin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
takepublic ByteString take(int n) - Specified by:
- takein interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- takein interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- takein interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
takeRightpublic ByteString takeRight(int n) - Specified by:
- takeRightin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- takeRightin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- takeRightin interface- scala.collection.StrictOptimizedIterableOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>
 
 - 
slicepublic ByteString slice(int from, int until) - Specified by:
- slicein interface- scala.collection.immutable.IndexedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,scala.collection.immutable.IndexedSeq<java.lang.Object>>
- Specified by:
- slicein interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- slicein interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- slicein interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
droppublic ByteString drop(int n) - Specified by:
- dropin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- dropin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- dropin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
dropRightpublic ByteString dropRight(int n) - Specified by:
- dropRightin interface- scala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>
- Specified by:
- dropRightin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- dropRightin interface- scala.collection.StrictOptimizedIterableOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>
 
 - 
takeWhilepublic ByteString takeWhile(scala.Function1<java.lang.Object,java.lang.Object> p) - Specified by:
- takeWhilein interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- takeWhilein interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
dropWhilepublic ByteString dropWhile(scala.Function1<java.lang.Object,java.lang.Object> p) - Specified by:
- dropWhilein interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- dropWhilein interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
spanpublic scala.Tuple2<ByteString,ByteString> span(scala.Function1<java.lang.Object,java.lang.Object> p) - Specified by:
- spanin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- spanin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- spanin interface- scala.collection.StrictOptimizedIterableOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>
 
 - 
splitAtpublic scala.Tuple2<ByteString,ByteString> splitAt(int n) - Specified by:
- splitAtin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
- Specified by:
- splitAtin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
indexWherepublic int indexWhere(scala.Function1<java.lang.Object,java.lang.Object> p, int from)- Specified by:
- indexWherein interface- scala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>
 
 - 
indexOfpublic <B> int indexOf(B elem, int from)- Specified by:
- indexOfin interface- scala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>
 
 - 
groupedpublic scala.collection.Iterator<ByteString> grouped(int size) - Specified by:
- groupedin interface- scala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
toStringpublic java.lang.String toString() - Specified by:
- toStringin interface- scala.Function1<java.lang.Object,java.lang.Object>
- Specified by:
- toStringin interface- scala.collection.Iterable<java.lang.Object>
- Specified by:
- toStringin interface- scala.collection.Seq<java.lang.Object>
- Overrides:
- toStringin class- java.lang.Object
 
 - 
toArrayprotected byte[] toArray() Java API: copy this ByteString into a fresh byte array- Returns:
- this ByteString copied into a byte array
 
 - 
toArraypublic final <B> java.lang.Object toArray(scala.reflect.ClassTag<B> arg0) - Specified by:
- toArrayin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
copyToArraypublic final <B> int copyToArray(java.lang.Object xs, int start)- Specified by:
- copyToArrayin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
copyToArraypublic <B> int copyToArray(java.lang.Object xs, int start, int len)- Specified by:
- copyToArrayin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
toArrayUnsafepublic byte[] toArrayUnsafe() Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.If the ByteString is backed by a single array it is returned without any copy. If it is backed by a rope of multiple ByteString instances a new array will be allocated and the contents will be copied into it before returning it. This method of exposing the bytes of a ByteString can save one array copy and allocation in the happy path scenario which can lead to better performance, however it also means that one MUST NOT modify the returned array, or unexpected immutable data structure contract-breaking behavior will manifest itself. This API is intended for users who need to pass the byte array to some other API, which will only read the bytes and never mutate then. For all other intents and purposes, please use the usual toArray method - which provide the immutability guarantees by copying the backing array. 
 - 
foreachpublic <U> void foreach(scala.Function1<java.lang.Object,U> f) - Specified by:
- foreachin interface- scala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>
 
 - 
$plus$pluspublic abstract ByteString $plus$plus(ByteString that) Efficiently concatenate another ByteString.
 - 
concatpublic ByteString concat(ByteString that) Java API: efficiently concatenate another ByteString.
 - 
copyToBufferpublic abstract 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
 
 - 
compactpublic 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.
 - 
isCompactpublic 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.
 - 
asByteBufferpublic abstract java.nio.ByteBuffer asByteBuffer() Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.
 - 
asByteBufferspublic 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.
 - 
getByteBufferspublic 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.
 - 
toByteBufferpublic java.nio.ByteBuffer toByteBuffer() Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.
 - 
utf8Stringpublic final java.lang.String utf8String() Decodes this ByteString as a UTF-8 encoded String.
 - 
decodeStringpublic abstract java.lang.String decodeString(java.lang.String charset) Decodes this ByteString using a charset to produce a String. If you have aCharsetinstance available, usedecodeString(charset: java.nio.charset.Charsetinstead.
 - 
decodeStringpublic 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 todecodeString(charset: String).
 - 
decodeBase64public abstract ByteString decodeBase64() 
 - 
encodeBase64public abstract ByteString encodeBase64() Returns a ByteString which is the Base64 representation of this ByteString
 - 
mapIpublic final ByteString mapI(scala.Function1<java.lang.Object,java.lang.Object> f) map method that will automatically cast Int back into Byte.
 - 
mappublic <A> ByteString map(scala.Function1<java.lang.Object,java.lang.Object> f) 
 
- 
 
-