public final class BytesTransformers extends Object
BytesTransformer for more specific use cases| Modifier and Type | Method and Description |
|---|---|
static BytesTransformer |
checksum(Checksum checksum,
at.favre.lib.bytes.BytesTransformers.ChecksumTransformer.Mode mode,
int checksumLengthByte)
Create a
BytesTransformer which transforms to 4 byte Crc32 checksum of given bytes |
static BytesTransformer |
checksumAppendCrc32()
Create a
BytesTransformer which appends 4 byte Crc32 checksum to given bytes |
static BytesTransformer |
checksumCrc32()
Create a
BytesTransformer which transforms to 4 byte Crc32 checksum of given bytes |
static BytesTransformer |
compressGzip()
Create a
BytesTransformer which gzip compresses the internal byte array |
static BytesTransformer |
decompressGzip()
Create a
BytesTransformer which gzip decompresses the internal byte array |
static BytesTransformer |
shuffle()
Create a
BytesTransformer which shuffles the individual bytes in an array
with an SecureRandom instance. |
static BytesTransformer |
shuffle(Random random)
Create a
BytesTransformer which shuffles the individual bytes in an array |
static BytesTransformer |
sort()
Create a
BytesTransformer which sorts the internal byte array with it's natural ordering. |
static BytesTransformer |
sort(Comparator<Byte> comparator)
Create a
BytesTransformer which sorts the internal byte array according to given comparator. |
public static BytesTransformer shuffle()
BytesTransformer which shuffles the individual bytes in an array
with an SecureRandom instance.public static BytesTransformer shuffle(Random random)
BytesTransformer which shuffles the individual bytes in an arrayrandom - to use for entropypublic static BytesTransformer sort()
BytesTransformer which sorts the internal byte array with it's natural ordering.public static BytesTransformer sort(Comparator<Byte> comparator)
BytesTransformer which sorts the internal byte array according to given comparator.comparator - to sort the bytespublic static BytesTransformer checksumAppendCrc32()
BytesTransformer which appends 4 byte Crc32 checksum to given bytespublic static BytesTransformer checksumCrc32()
BytesTransformer which transforms to 4 byte Crc32 checksum of given bytespublic static BytesTransformer checksum(Checksum checksum, at.favre.lib.bytes.BytesTransformers.ChecksumTransformer.Mode mode, int checksumLengthByte)
BytesTransformer which transforms to 4 byte Crc32 checksum of given byteschecksum - used algorithmmode - mode (append or convert)checksumLengthByte - the byte length of the checksum; the Checksum class always returns 8 byte, but some
checksum algorithms (e.g. CRC32) only require smaller output. Must be between 1 and 8 byte.public static BytesTransformer compressGzip()
BytesTransformer which gzip compresses the internal byte arrayIllegalStateException - if compression was not possible (i.e. wrapped IOException)public static BytesTransformer decompressGzip()
BytesTransformer which gzip decompresses the internal byte arrayIllegalStateException - if compression was not possible (i.e. wrapped IOException)Copyright © 2017. All rights reserved.