public class BitShuffle extends Object
Constructor and Description |
---|
BitShuffle() |
Modifier and Type | Method and Description |
---|---|
static int |
shuffle(ByteBuffer input,
BitShuffleType type,
ByteBuffer shuffled)
Apply a bit-shuffling filter into the content in the given input buffer.
|
static byte[] |
shuffle(double[] input)
Apply a bit-shuffling filter into the input double array.
|
static byte[] |
shuffle(float[] input)
Apply a bit-shuffling filter into the input float array.
|
static byte[] |
shuffle(int[] input)
Apply a bit-shuffling filter into the input int array.
|
static byte[] |
shuffle(long[] input)
Apply a bit-shuffling filter into the input long array.
|
static byte[] |
shuffle(short[] input)
Apply a bit-shuffling filter into the input short array.
|
static int |
unshuffle(ByteBuffer shuffled,
BitShuffleType type,
ByteBuffer output)
Convert the input bit-shuffled byte array into an original array.
|
static double[] |
unshuffleDoubleArray(byte[] input)
Convert the input bit-shuffled byte array into an original double array.
|
static float[] |
unshuffleFloatArray(byte[] input)
Convert the input bit-shuffled byte array into an original float array.
|
static int[] |
unshuffleIntArray(byte[] input)
Convert the input bit-shuffled byte array into an original int array.
|
static long[] |
unshuffleLongArray(byte[] input)
Convert the input bit-shuffled byte array into an original long array.
|
static short[] |
unshuffleShortArray(byte[] input)
Convert the input bit-shuffled byte array into an original short array.
|
public static int shuffle(ByteBuffer input, BitShuffleType type, ByteBuffer shuffled) throws IOException
input
- buffer[pos() ... limit()) containing the input datatype
- element type of the input datashuffled
- output of the shuffled data. Uses range [pos()..].SnappyError
- when the input is not a direct bufferIllegalArgumentException
- when the input length is not a multiple of the given type sizeIOException
public static byte[] shuffle(short[] input) throws IOException
input
- IOException
public static byte[] shuffle(int[] input) throws IOException
input
- IOException
public static byte[] shuffle(long[] input) throws IOException
input
- IOException
public static byte[] shuffle(float[] input) throws IOException
input
- IOException
public static byte[] shuffle(double[] input) throws IOException
input
- IOException
public static int unshuffle(ByteBuffer shuffled, BitShuffleType type, ByteBuffer output) throws IOException
shuffled
- buffer[pos() ... limit()) containing the input shuffled datatype
- element type of the input dataoutput
- output of the the original data. It uses buffer[pos()..]IOException
- when failed to unshuffle the given inputSnappyError
- when the input is not a direct bufferIllegalArgumentException
- when the length of input shuffled data is not a multiple of the given type sizepublic static short[] unshuffleShortArray(byte[] input) throws IOException
input
- IOException
public static int[] unshuffleIntArray(byte[] input) throws IOException
input
- IOException
public static long[] unshuffleLongArray(byte[] input) throws IOException
input
- IOException
public static float[] unshuffleFloatArray(byte[] input) throws IOException
input
- IOException
public static double[] unshuffleDoubleArray(byte[] input) throws IOException
input
- IOException
Copyright © 2024 xerial.org. All rights reserved.