Class ByteString.ByteString1C
- java.lang.Object
-
- akka.util.ByteString
-
- akka.util.CompactByteString
-
- akka.util.ByteString.ByteString1C
-
- All Implemented Interfaces:
java.io.Serializable,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>
- Enclosing class:
- ByteString
public static final class ByteString.ByteString1C extends CompactByteString
A compact (unsliced) and unfragmented ByteString, implementation of ByteString1C.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.util.ByteString
ByteString.ByteString1, ByteString.ByteString1$, ByteString.ByteString1C, ByteString.ByteString1C$, ByteString.ByteStrings, ByteString.ByteStrings$, ByteString.Companion, ByteString.Companion$
-
Nested classes/interfaces inherited from interface scala.Function1
scala.Function1.UnliftOps<A extends java.lang.Object,B extends java.lang.Object>, scala.Function1.UnliftOps$
-
-
Constructor Summary
Constructors Constructor Description ByteString1C()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteString$plus$plus(ByteString that)Efficiently concatenate another ByteString.byteapply(int idx)java.nio.ByteBufferasByteBuffer()Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.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.<B> intcopyToArray(java.lang.Object dest, int start, int len)intcopyToBuffer(java.nio.ByteBuffer buffer)Copy as many bytes as possible to a ByteBuffer, starting from it's current position.ByteStringdecodeBase64()java.lang.StringdecodeString(java.lang.String charset)Decodes this ByteString using a charset to produce a String.java.lang.StringdecodeString(java.nio.charset.Charset charset)Decodes this ByteString using a charset to produce a String.ByteStringdrop(int n)ByteStringdropRight(int n)ByteStringencodeBase64()Returns a ByteString which is the Base64 representation of this ByteString<B> intindexOf(B elem, int from)ByteIterator.ByteArrayIteratoriterator()intlength()ByteStringslice(int from, int until)ByteStringtake(int n)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.-
Methods inherited from class akka.util.CompactByteString
apply, apply, apply, apply, apply, apply, apply, apply, compact, empty, fromArray, isCompact
-
Methods inherited from class akka.util.ByteString
className, concat, copyToArray, createBuilder, dropWhile, empty, emptyByteString, foreach, fromArray, fromArrayUnsafe, fromArrayUnsafe, fromByteBuffer, fromInts, fromInts, fromSpecific, fromString, fromString, fromString, getByteBuffers, grouped, head, indexWhere, init, isEmpty, last, map, mapI, newBuilder, newSpecificBuilder, span, splitAt, tail, takeRight, takeWhile, toArray, toArray, toByteBuffer, toString, UTF_8, utf8String
-
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.immutable.IndexedSeq
applyPreferredMaxLength, canEqual, iterableFactory, sameElements, toIndexedSeq
-
Methods inherited from interface scala.collection.IndexedSeqOps
foldRight, headOption, knownSize, lengthCompare, lengthCompare, map, prepended, reverse, reversed, reverseIterator, search, search, stepper, view, view
-
Methods inherited from interface scala.collection.Iterable
coll, 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.PartialFunction
andThen, 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, 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.StrictOptimizedIterableOps
collect, filter, filterImpl, filterNot, flatMap, flatten, map, partition, partitionMap, scanLeft, strictOptimizedCollect, strictOptimizedConcat, strictOptimizedFlatMap, strictOptimizedFlatten, strictOptimizedMap, strictOptimizedZip, tapEach, unzip, unzip3, zip, zipWithIndex
-
-
-
-
Method Detail
-
apply
public byte apply(int idx)
- Specified by:
applyin interfacescala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>- Specified by:
applyin classByteString
-
length
public int length()
-
iterator
public ByteIterator.ByteArrayIterator iterator()
- Specified by:
iteratorin interfacescala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>- Specified by:
iteratorin interfacescala.collection.IterableOnce<java.lang.Object>- Overrides:
iteratorin classByteString
-
asByteBuffer
public java.nio.ByteBuffer asByteBuffer()
Description copied from class:ByteStringReturns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.- Specified by:
asByteBufferin classByteString
-
asByteBuffers
public scala.collection.immutable.Iterable<java.nio.ByteBuffer> asByteBuffers()
Description copied from class:ByteStringScala 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:
asByteBuffersin classByteString
-
decodeString
public java.lang.String decodeString(java.lang.String charset)
Description copied from class:ByteStringDecodes this ByteString using a charset to produce a String. If you have aCharsetinstance available, usedecodeString(charset: java.nio.charset.Charsetinstead.- Specified by:
decodeStringin classByteString
-
decodeString
public java.lang.String decodeString(java.nio.charset.Charset charset)
Description copied from class:ByteStringDecodes this ByteString using a charset to produce a String. Avoids Charset.forName lookup in String internals, thus is preferable todecodeString(charset: String).- Specified by:
decodeStringin classByteString
-
decodeBase64
public ByteString decodeBase64()
- Specified by:
decodeBase64in classByteString
-
encodeBase64
public ByteString encodeBase64()
Description copied from class:ByteStringReturns a ByteString which is the Base64 representation of this ByteString- Specified by:
encodeBase64in classByteString
-
$plus$plus
public ByteString $plus$plus(ByteString that)
Description copied from class:ByteStringEfficiently concatenate another ByteString.- Specified by:
$plus$plusin classByteString
-
take
public ByteString take(int n)
- Specified by:
takein interfacescala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>- Specified by:
takein interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Specified by:
takein interfacescala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Overrides:
takein classByteString
-
dropRight
public ByteString dropRight(int n)
- Specified by:
dropRightin interfacescala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>- Specified by:
dropRightin interfacescala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Specified by:
dropRightin interfacescala.collection.StrictOptimizedIterableOps<java.lang.Object,scala.collection.immutable.IndexedSeq,ByteString>- Overrides:
dropRightin classByteString
-
drop
public ByteString drop(int n)
- Specified by:
dropin interfacescala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>- Specified by:
dropin interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Specified by:
dropin interfacescala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Overrides:
dropin classByteString
-
indexOf
public <B> int indexOf(B elem, int from)- Specified by:
indexOfin interfacescala.collection.SeqOps<java.lang.Object,scala.collection.Seq,scala.collection.Seq<java.lang.Object>>- Overrides:
indexOfin classByteString
-
slice
public ByteString slice(int from, int until)
- Specified by:
slicein interfacescala.collection.immutable.IndexedSeqOps<java.lang.Object,scala.collection.immutable.IndexedSeq,scala.collection.immutable.IndexedSeq<java.lang.Object>>- Specified by:
slicein interfacescala.collection.IndexedSeqOps<java.lang.Object,scala.collection.IndexedSeq,scala.collection.IndexedSeq<java.lang.Object>>- Specified by:
slicein interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Specified by:
slicein interfacescala.collection.IterableOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Overrides:
slicein classByteString
-
copyToBuffer
public int copyToBuffer(java.nio.ByteBuffer buffer)
Description copied from class:ByteStringCopy as many bytes as possible to a ByteBuffer, starting from it's current position. This method will not overflow the buffer.- Specified by:
copyToBufferin classByteString- Parameters:
buffer- a ByteBuffer to copy bytes to- Returns:
- the number of bytes actually copied
-
copyToArray
public <B> int copyToArray(java.lang.Object dest, int start, int len)- Specified by:
copyToArrayin interfacescala.collection.IterableOnceOps<java.lang.Object,scala.collection.Iterable,scala.collection.Iterable>- Overrides:
copyToArrayin classByteString
-
toArrayUnsafe
public byte[] toArrayUnsafe()
Description copied from class:ByteStringUnsafe 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.
- Overrides:
toArrayUnsafein classByteString
-
-