public final class MutableBytes extends Bytes
Bytes
created by calling Bytes.mutable()
. If possible, all transformations are done in place, without creating a copy.
Adds additional mutator, which may change the internal array in-place, like wipe()
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Checks if this instance is equal to given other instance o
|
MutableBytes |
fill(byte fillByte)
Fills the internal byte array with provided byte
|
int |
hashCode() |
Bytes |
immutable()
Convert this instance to an immutable version with the same reference of the internal array and byte-order.
|
boolean |
isMutable()
Checks if instance is mutable
|
MutableBytes |
overwrite(byte[] newArray)
Uses given array to overwrite internal array
|
MutableBytes |
overwrite(byte[] newArray,
int offsetInternalArray)
Uses given array to overwrite internal array.
|
MutableBytes |
secureWipe()
Fills the internal byte array with random data provided by
SecureRandom |
MutableBytes |
secureWipe(SecureRandom random)
Fills the internal byte array with random data provided by given random instance
|
MutableBytes |
setByteAt(int index,
byte newByte)
Sets new byte to given index
|
MutableBytes |
wipe()
Fills the internal byte array with all zeros
|
allocate, allocate, and, and, append, append, append, append, append, append, append, append, append, appendNullSafe, array, bitAt, buffer, byteAt, byteOrder, byteOrder, charAt, compareTo, contains, copy, copy, count, count, duplicate, empty, encode, encodeBase36, encodeBase64, encodeBase64Url, encodeBinary, encodeCharset, encodeCharsetToBytes, encodeDec, encodeHex, encodeHex, encodeOctal, encodeUtf8, encodeUtf8ToBytes, endsWith, entropy, equals, equals, equals, equalsConstantTime, equalsContent, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, fromNullSafe, hash, hashMd5, hashSha1, hashSha256, indexOf, indexOf, indexOf, indexOf, inputStream, intAt, isEmpty, isReadOnly, iterator, lastIndexOf, leftShift, length, lengthBit, longAt, mutable, not, or, or, parse, parseBase36, parseBase64, parseBinary, parseDec, parseHex, parseOctal, random, random, readOnly, resize, resize, reverse, rightShift, shortAt, startsWith, switchBit, switchBit, toBigInteger, toBitSet, toBoxedArray, toByte, toChar, toDouble, toFloat, toInt, toList, toLong, toObjectArray, toShort, toString, toUnsignedByte, toUUID, transform, unsignedByteAt, validate, validateNotOnlyZeros, wrap, wrap, wrap, wrapNullSafe, xor, xor
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public boolean isMutable()
Bytes
public MutableBytes overwrite(byte[] newArray)
newArray
- used to overwrite internalIndexOutOfBoundsException
- if newArray.length > internal lengthpublic MutableBytes overwrite(byte[] newArray, int offsetInternalArray)
newArray
- used to overwrite internaloffsetInternalArray
- index of the internal array to start overwritingIndexOutOfBoundsException
- if newArray.length + offsetInternalArray > internal lengthpublic MutableBytes setByteAt(int index, byte newByte)
index
- the index to changenewByte
- the new byte to setpublic MutableBytes wipe()
public MutableBytes fill(byte fillByte)
fillByte
- to fill withpublic MutableBytes secureWipe()
SecureRandom
public MutableBytes secureWipe(SecureRandom random)
random
- to generate entropypublic Bytes immutable()
Copyright © 2017–2018. All rights reserved.