mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-21 21:14:31 +02:00
Add uncompressDoubleArray that takes offset and length (#307)
This commit is contained in:
parent
2bc841b5da
commit
34fa6e9e65
@ -598,9 +598,24 @@ public class Snappy
|
|||||||
public static double[] uncompressDoubleArray(byte[] input)
|
public static double[] uncompressDoubleArray(byte[] input)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
int uncompressedLength = Snappy.uncompressedLength(input, 0, input.length);
|
return uncompressDoubleArray(input, 0, input.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uncompress the input as a double array
|
||||||
|
*
|
||||||
|
* @param input
|
||||||
|
* @param offset
|
||||||
|
* @param length
|
||||||
|
* @return the uncompressed data
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public static double[] uncompressDoubleArray(byte[] input, int offset, int length)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
int uncompressedLength = Snappy.uncompressedLength(input, offset, length);
|
||||||
double[] result = new double[uncompressedLength / 8];
|
double[] result = new double[uncompressedLength / 8];
|
||||||
impl.rawUncompress(input, 0, input.length, result, 0);
|
impl.rawUncompress(input, offset, length, result, 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user