public final class VarByte extends Object implements Externalizable
| Modifier and Type | Method and Description |
|---|---|
VarByte |
add(boolean b) |
VarByte |
add(byte c) |
VarByte |
add(byte[] bytes) |
VarByte |
add(double d) |
VarByte |
add(float f) |
VarByte |
add(int i) |
VarByte |
add(long l) |
VarByte |
add(short s) |
VarByte |
add(String s) |
VarByte |
add(VarByte varByte) |
VarByte |
append(boolean value) |
VarByte |
append(byte value) |
VarByte |
append(byte[] bytes) |
VarByte |
append(byte[] bytes,
int offset,
int length) |
VarByte |
append(char value) |
VarByte |
append(double value) |
VarByte |
append(float value) |
VarByte |
append(int value) |
VarByte |
append(long value) |
VarByte |
append(short value) |
VarByte |
appendArray(byte... bytes) |
VarByte |
apply(Consumer<? super VarByte> procedure) |
VarByte |
clear()
Only preferable to
reset() for security reasons. |
boolean |
contains(byte c) |
int |
count(byte c) |
VarByte |
deleteByteAt(int index) |
VarByte |
deleteLast(int n) |
VarByte |
deleteLastByte() |
void |
ensureFreeCapacity(int requiredFreeCapacity) |
byte |
firstByte() |
byte |
get(int index) |
void |
getBytes(int srcBegin,
int srcEnd,
byte[] dst,
int dstBegin) |
static boolean |
hasContent(VarByte varByte) |
static boolean |
hasNoContent(VarByte varByte) |
int |
indexOf(byte c) |
int |
indexOf(byte[] bytes) |
int |
indexOf(byte[] bytes,
int offset) |
int |
indexOf(byte c,
int fromIndex) |
boolean |
isEmpty() |
byte |
lastByte() |
int |
lastIndexOf(byte c) |
int |
lastIndexOf(byte c,
int fromIndex) |
int |
length() |
static VarByte |
New() |
static VarByte |
New(int initialCapacity)
Use this constructor only if really a specific size is needed or of the text to be handled is really big.
Otherwise, use the factory methods as they are faster due to skipping capacity checks and bounds adjustment. |
VarByte |
printlnTo(PrintStream printStream)
Passes a copy of the internal byte array to the
PrintStream.println(String) method of the passed
PrintStream instance. |
VarByte |
printTo(PrintStream printStream)
Passes a copy of the internal byte array to the
PrintStream.print(String) method of the passed
PrintStream instance. |
void |
process(_byteProcedure processor) |
void |
readExternal(ObjectInput in) |
VarByte |
repeat(int amount,
byte b) |
VarByte |
replaceFirst(byte sample,
byte replacement) |
VarByte |
replaceFirst(int beginIndex,
byte sample,
byte replacement) |
VarByte |
reset() |
VarByte |
reverse() |
VarByte |
setByte(int index,
byte c) |
VarByte |
setBytes(int index,
byte... c) |
VarByte |
setLastByte(byte c) |
VarByte |
shrinkTo(int n) |
VarByte |
subsequence(int beginIndex,
int endIndex) |
VarByte |
subSequence(int start,
int end) |
VarByte |
surrogateByteReverse()
Deprecated.
not implemented yet. Currently just does
reverse(). |
byte[] |
toByteArray() |
String |
toString() |
String |
toString(Charset charset) |
void |
trimToSize() |
void |
truncate() |
void |
writeExternal(ObjectOutput out) |
public static VarByte New()
public static VarByte New(int initialCapacity)
Note that the given initialCapacity will still be adjusted to the next higher 2^n bounding value.
initialCapacity - the initial size of the bufferpublic byte get(int index)
public byte lastByte()
public byte firstByte()
public int length()
public VarByte subSequence(int start, int end)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic String toString(Charset charset) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic VarByte add(boolean b)
public VarByte add(byte c)
public VarByte add(short s)
public VarByte add(int i)
public VarByte add(long l)
public VarByte add(float f)
public VarByte add(double d)
public VarByte add(byte[] bytes)
public void ensureFreeCapacity(int requiredFreeCapacity)
public VarByte appendArray(byte... bytes)
public VarByte append(byte[] bytes)
public VarByte append(byte[] bytes, int offset, int length)
public VarByte append(byte value)
public VarByte append(boolean value)
public VarByte append(short value)
public VarByte append(char value)
public VarByte append(int value)
public VarByte append(float value)
public VarByte append(long value)
public VarByte append(double value)
public VarByte setByte(int index, byte c)
public VarByte setBytes(int index, byte... c)
public VarByte setLastByte(byte c)
public VarByte reverse()
@Deprecated public VarByte surrogateByteReverse()
reverse().public int indexOf(byte c)
public int indexOf(byte c,
int fromIndex)
public int indexOf(byte[] bytes)
public int indexOf(byte[] bytes,
int offset)
public boolean contains(byte c)
public int lastIndexOf(byte c)
public int lastIndexOf(byte c,
int fromIndex)
public int count(byte c)
public VarByte deleteByteAt(int index)
public VarByte deleteLastByte()
public VarByte deleteLast(int n)
public VarByte shrinkTo(int n)
public byte[] toByteArray()
public void getBytes(int srcBegin,
int srcEnd,
byte[] dst,
int dstBegin)
public boolean isEmpty()
public void trimToSize()
public static final boolean hasNoContent(VarByte varByte)
varByte - the VarByte to checktrue if varByte is either null or empty.isEmpty()public static final boolean hasContent(VarByte varByte)
public VarByte replaceFirst(byte sample, byte replacement)
public VarByte replaceFirst(int beginIndex, byte sample, byte replacement)
public VarByte subsequence(int beginIndex, int endIndex)
public void process(_byteProcedure processor)
public final VarByte reset()
public void truncate()
public VarByte printlnTo(PrintStream printStream)
PrintStream.println(String) method of the passed
PrintStream instance.
The purpose of this method is to spare the unnecessary String instantiation of the generic method
PrintStream.println(Object).
printStream - the PrintStream instance to be written to.VarByte instance.public VarByte printTo(PrintStream printStream)
PrintStream.print(String) method of the passed
PrintStream instance.
The purpose of this method is to spare the unnecessary String instantiation of the generic method
PrintStream.println(Object).
printStream - the PrintStream instance to be written to.VarByte instance.public VarByte repeat(int amount, byte b)
Copyright © 2022 MicroStream Software. All rights reserved.