Package org.apache.pekko.util
Class ByteStringBuilder
java.lang.Object
org.apache.pekko.util.ByteStringBuilder
- All Implemented Interfaces:
- scala.collection.mutable.Builder<Object,,- ByteString> - scala.collection.mutable.Clearable,- scala.collection.mutable.Growable<Object>
public final class ByteStringBuilder
extends Object
implements scala.collection.mutable.Builder<Object,ByteString> 
A mutable builder for efficiently creating a 
ByteString.
 The created ByteString is not automatically compacted.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription$plus$plus$eq(ByteString bytes) addAll(ByteString bytes) addOne(byte elem) append(ByteString bs) Java API: append a ByteString to this builder.Directly wraps this ByteStringBuilder in an OutputStream.voidclear()protected ByteStringBuilderprotected final ByteStringBuilderfillByteBuffer(int len, ByteOrder byteOrder, scala.Function1<ByteBuffer, scala.runtime.BoxedUnit> fill) booleanisEmpty()Tests whether this ByteStringBuilder is empty.intlength()booleannonEmpty()Tests whether this ByteStringBuilder is not empty.putByte(byte x) Add a single Byte to this builder.putBytes(byte[] array) Add a number of Bytes from an array to this builder.putBytes(byte[] array, int start, int len) Add a number of Bytes from an array to this builder.Add a single Double to this builder.putDoubles(double[] array, int start, int len, ByteOrder byteOrder) Add a number of Doubles from an array to this builder.putDoubles(double[] array, ByteOrder byteOrder) Add a number of Doubles from an array to this builder.Add a single Float to this builder.Add a number of Floats from an array to this builder.Add a number of Floats from an array to this builder.Add a single Int to this builder.Add a number of Ints from an array to this builder.Add a number of Ints from an array to this builder.Add a single Long to this builder.putLongPart(long x, int n, ByteOrder byteOrder) Add thenleast significant bytes of the given Long to this builder.Add a number of Longs from an array to this builder.Add a number of Longs from an array to this builder.Add a single Short to this builder.Add a number of Shorts from an array to this builder.Add a number of Shorts from an array to this builder.result()voidsizeHint(int len) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface scala.collection.mutable.BuildermapResult, sizeHint, sizeHint$default$2, sizeHintBoundedMethods inherited from interface scala.collection.mutable.Growable$plus$eq, $plus$eq, $plus$plus$eq, addOne, knownSize
- 
Constructor Details- 
ByteStringBuilderpublic ByteStringBuilder()
 
- 
- 
Method Details- 
$plus$plus$eq
- 
addAll
- 
addAll- Specified by:
- addAllin interface- scala.collection.mutable.Growable<Object>
 
- 
addOne
- 
appendJava API: append a ByteString to this builder.
- 
asOutputStreamDirectly wraps this ByteStringBuilder in an OutputStream. Write operations on the stream are forwarded to the builder.
- 
clearpublic void clear()- Specified by:
- clearin interface- scala.collection.mutable.Builder<Object,- ByteString> 
- Specified by:
- clearin interface- scala.collection.mutable.Clearable
 
- 
fillArrayprotected ByteStringBuilder fillArray(int len, scala.Function2<byte[], Object, scala.runtime.BoxedUnit> fill) 
- 
fillByteBufferprotected final ByteStringBuilder fillByteBuffer(int len, ByteOrder byteOrder, scala.Function1<ByteBuffer, scala.runtime.BoxedUnit> fill) 
- 
isEmptypublic boolean isEmpty()Tests whether this ByteStringBuilder is empty.
- 
lengthpublic int length()
- 
nonEmptypublic boolean nonEmpty()Tests whether this ByteStringBuilder is not empty.
- 
putByteAdd a single Byte to this builder.
- 
putBytesAdd a number of Bytes from an array to this builder.
- 
putBytesAdd a number of Bytes from an array to this builder.
- 
putDoubleAdd a single Double to this builder.
- 
putDoublesAdd a number of Doubles from an array to this builder.
- 
putDoublesAdd a number of Doubles from an array to this builder.
- 
putFloatAdd a single Float to this builder.
- 
putFloatsAdd a number of Floats from an array to this builder.
- 
putFloatsAdd a number of Floats from an array to this builder.
- 
putIntAdd a single Int to this builder.
- 
putIntsAdd a number of Ints from an array to this builder.
- 
putIntsAdd a number of Ints from an array to this builder.
- 
putLongAdd a single Long to this builder.
- 
putLongPartAdd thenleast significant bytes of the given Long to this builder.
- 
putLongsAdd a number of Longs from an array to this builder.
- 
putLongsAdd a number of Longs from an array to this builder.
- 
putShortAdd a single Short to this builder.
- 
putShortsAdd a number of Shorts from an array to this builder.
- 
putShortsAdd a number of Shorts from an array to this builder.
- 
result- Specified by:
- resultin interface- scala.collection.mutable.Builder<Object,- ByteString> 
 
- 
sizeHintpublic void sizeHint(int len) - Specified by:
- sizeHintin interface- scala.collection.mutable.Builder<Object,- ByteString> 
 
 
-