public class BinaryTimeseries extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte |
DTYPE_BYTE
Identifier value for
byte datatype. |
static byte |
DTYPE_DOUBLE
Identifier value for
double datatype. |
static byte |
DTYPE_FLOAT
Identifier value for
float datatype. |
static byte |
DTYPE_INT
Identifier value for
int datatype. |
static byte |
DTYPE_LONG
Identifier value for
long datatype. |
static byte |
DTYPE_NONE
Identifier value used to indicate that no raw data scaling is used.
|
static byte |
DTYPE_SHORT
Identifier value for
short datatype. |
| Constructor and Description |
|---|
BinaryTimeseries() |
| Modifier and Type | Method and Description |
|---|---|
static void |
buildTimebase(double[] target,
double t0,
double dt)
Compute the timebase values for a given t_0 and Delta_t.
|
static void |
buildTimebase(int sourceOffset,
double[] target,
int targetOffset,
int numSamples,
double t0,
double dt)
Compute the timebase values for a given t_0 and Delta_t.
|
static void |
buildTimebase(int sourceOffset,
long[] target,
int targetOffset,
int numSamples,
long t0,
long dt)
Compute the timebase values for a given t_0 and Delta_t.
|
static void |
buildTimebase(long[] target,
long t0,
long dt)
Compute the timebase values for a given t_0 and Delta_t.
|
static String |
dtypeStr(byte dtype)
Get a human-readable identification string for a given data type.
|
static String |
explainHeader(byte[] header)
Given 64 header bytes, generate a human-readable explanation similar to Tab.
|
static int |
fileOffset(int dataSize,
int index)
Compute the file offset (and buffer size when reading the file) in bytes
given the size of the contained raw data type and the number of
samples/index.
|
static int |
firstIndexInside(double t0,
double dt,
double t_l)
Given a timebase (t0, dt), compute the first index of timestamps inside the
given time interval [
t_l, t_u]. |
static int |
firstIndexInside(long t0,
long dt,
long t_l)
Given a timebase (t0, dt), compute the first index of timestamps inside the
given time interval [
t_l, t_u]. |
static boolean |
hasScaling(byte scaling_dtype)
Check the given dtype byte to see if the given file has a value scaling or
not.
|
static int |
lastIndexInside(double t0,
double dt,
double t_u)
Given a timebase (t0, dt), compute the first index of timestamps inside the
given time interval [
t_l, t_u]. |
static int |
lastIndexInside(long t0,
long dt,
long t_u)
Given a timebase (t0, dt), compute the first index of timestamps inside the
given time interval [
t_l, t_u]. |
static byte[] |
readData_byte(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
byte[] array. |
static byte[] |
readData_byte(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
byte[] array. |
static double[] |
readData_double(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
double[] array. |
static double[] |
readData_double(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
double[] array. |
static float[] |
readData_float(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
float[] array. |
static float[] |
readData_float(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
float[] array. |
static int[] |
readData_int(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
int[] array. |
static int[] |
readData_int(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
int[] array. |
static long[] |
readData_long(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
long[] array. |
static long[] |
readData_long(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
long[] array. |
static short[] |
readData_short(ByteBuffer source)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
short[] array. |
static short[] |
readData_short(ByteBuffer source,
int firstDataIndex,
int lastDataIndex)
Read the scaling parameters, the reserved (dummy) area, the raw data type and
number of samples and the raw data; scale the raw data according to the
(possibly present) scaling parameters and put the resulting samples into a
short[] array. |
static byte |
readDataType(ByteBuffer source)
Read the raw data type from the given
source buffer. |
static boolean |
readEndianessOk(ByteBuffer source)
Read the first
short value from the source buffer and check
if it was correctly read as 1. |
static byte[] |
readHeader(ByteBuffer source)
Read the 64 byte header from the given source buffer.
|
static int |
readNumSamples(ByteBuffer source)
Read the number of samples from the given
source buffer. |
static void |
readRawData(ByteBuffer source,
byte[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readRawData(ByteBuffer source,
double[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readRawData(ByteBuffer source,
float[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readRawData(ByteBuffer source,
int[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readRawData(ByteBuffer source,
long[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readRawData(ByteBuffer source,
short[] target,
int targetOffset,
int numSamples)
Read the raw data from the given
source buffer and put them into a
given target array at an offset specified by targetOffset. |
static void |
readReservedDummy(ByteBuffer source)
Proceed with reading from the given
source buffer over the bytes
reserved in the header. |
static void |
readScalingDisabled(ByteBuffer source)
Proceed with reading from the given
source buffer over the bytes
reserved in the header for optional scaling parameters. |
static byte |
readScalingFactor_byte(ByteBuffer source)
Read the scaling factor from the given
source buffer as byte
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static double |
readScalingFactor_double(ByteBuffer source)
Read the scaling factor from the given
source buffer as
double. |
static float |
readScalingFactor_float(ByteBuffer source)
Read the scaling factor from the given
source buffer as float
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static int |
readScalingFactor_int(ByteBuffer source)
Read the scaling factor from the given
source buffer as int
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static long |
readScalingFactor_long(ByteBuffer source)
Read the scaling factor from the given
source buffer as long. |
static short |
readScalingFactor_short(ByteBuffer source)
Read the scaling factor from the given
source buffer as short
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static byte |
readScalingOffset_byte(ByteBuffer source)
Read the scaling offset from the given
source buffer as byte
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static double |
readScalingOffset_double(ByteBuffer source)
Read the scaling offset from the given
source buffer as
double. |
static float |
readScalingOffset_float(ByteBuffer source)
Read the scaling offset from the given
source buffer as float
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static int |
readScalingOffset_int(ByteBuffer source)
Read the scaling offset from the given
source buffer as int
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static long |
readScalingOffset_long(ByteBuffer source)
Read the scaling offset from the given
source buffer as long. |
static short |
readScalingOffset_short(ByteBuffer source)
Read the scaling offset from the given
source buffer as short
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure. |
static byte |
readScalingType(ByteBuffer source)
Read the scaling data type from the given
source buffer. |
static double |
readTimeDt_double(ByteBuffer source)
Read the time interval between two consecutive samples Delta_t from the given
source buffer. |
static long |
readTimeDt_long(ByteBuffer source)
Read the time interval between two consecutive samples Delta_t from the given
source buffer. |
static double |
readTimeT0_double(ByteBuffer source)
Read the reference timestamp t_0 from the given
source buffer. |
static long |
readTimeT0_long(ByteBuffer source)
Read the reference timestamp t_0 from the given
source buffer. |
static byte |
readTimeType(ByteBuffer source)
Read the timestamp data type from the
source buffer. |
static void |
write(ByteBuffer target,
Object t0,
Object dt,
Object rawData)
Create a BinaryTimeseries with the timebase parameters
t0 and
dt and the unscaled rawData. |
static void |
write(ByteBuffer target,
Object t0,
Object dt,
Object rawData,
Object scalingOffset,
Object scalingFactor)
Create a BinaryTimeseries with the timebase parameters
t0 and
dt and the unscaled rawData and the scaling parameters
scalingOffset and scalingFactor. |
static void |
writeData(ByteBuffer target,
byte[] values)
Write the raw data values into the
target buffer. |
static void |
writeData(ByteBuffer target,
double[] values)
Write the raw data values into the
target buffer. |
static void |
writeData(ByteBuffer target,
float[] values)
Write the raw data values into the
target buffer. |
static void |
writeData(ByteBuffer target,
int[] values)
Write the raw data values into the
target buffer. |
static void |
writeData(ByteBuffer target,
long[] values)
Write the raw data values into the
target buffer. |
static void |
writeData(ByteBuffer target,
short[] values)
Write the raw data values into the
target buffer. |
static void |
writeEndianessCheckValue(ByteBuffer target)
Write a 1 as
short to the target file. |
static void |
writeReservedDummy(ByteBuffer target)
Write zeros for the reserved area in the header.
|
static void |
writeScaling(ByteBuffer target,
byte o,
byte s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScaling(ByteBuffer target,
double o,
double s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScaling(ByteBuffer target,
float o,
float s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScaling(ByteBuffer target,
int o,
int s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScaling(ByteBuffer target,
long o,
long s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScaling(ByteBuffer target,
short o,
short s)
Write the scaling parameters o and s into the
target buffer. |
static void |
writeScalingDisabled(ByteBuffer target)
Write the identifier value into the
target buffer that tells the
reader that no scaling is available. |
static void |
writeTimebase(ByteBuffer target,
double t0,
double dt)
Write the timebase parameters t0 and dt to the
target buffer. |
static void |
writeTimebase(ByteBuffer target,
long t0,
long dt)
Write the timebase parameters t0 and dt to the
target buffer. |
public static final byte DTYPE_NONE
public static final byte DTYPE_BYTE
byte datatype. public static final byte DTYPE_SHORT
short datatype. public static final byte DTYPE_INT
int datatype. public static final byte DTYPE_LONG
long datatype. public static final byte DTYPE_FLOAT
float datatype. public static final byte DTYPE_DOUBLE
double datatype. public static final String dtypeStr(byte dtype)
dtype - one of [DTYPE_NONE, DTYPE_BYTE, DTYPE_SHORT, DTYPE_INT,
DTYPE_LONG, DTYPE_FLOAT, DTYPE_DOUBLE]public static final void buildTimebase(long[] target,
long t0,
long dt)
target array, into which the values are
put.target - [N] array into which to put the timebase values t_i.t0 - reference timestamp; will go into target[0]dt - time interval between two samplespublic static final void buildTimebase(int sourceOffset,
long[] target,
int targetOffset,
int numSamples,
long t0,
long dt)
target from sourceOffset up to and including
sourceOffset+numSamples-1 are filled with appropriate values of the
timebase.sourceOffset - offset in the time series indicestarget - [numSamples] array into which to put the timebase values
t_itargetOffset - index at which to put t_0 in the target arraynumSamples - number of time stamps to generate; has to greater than or
equal to target.lengtht0 - reference timestamp; will go into
target[targetOffset]dt - time interval between two consecutive samplespublic static final void buildTimebase(double[] target,
double t0,
double dt)
target array, into which the values are
put.target - [N] array into which to put the timebase values t_i.t0 - reference timestamp; will go into target[0]dt - time interval between two samplespublic static final void buildTimebase(int sourceOffset,
double[] target,
int targetOffset,
int numSamples,
double t0,
double dt)
target from sourceOffset up to and including
sourceOffset+numSamples-1 are filled with appropriate values of the
timebase.sourceOffset - offset in the time series indicestarget - [numSamples] array into which to put the timebase values
t_itargetOffset - index at which to put t_0 in the target arraynumSamples - number of time stamps to generate; has to greater than or
equal to target.lengtht0 - reference timestamp; will go into
target[targetOffset]dt - time interval between two consecutive samplespublic static final int firstIndexInside(long t0,
long dt,
long t_l)
t_l, t_u]. See also Eqn. (7) in the
documentation.t0 - reference timestamp from the filedt - time interval between two consecutive samples from the filet_l - lower boundary of the time interval to read data fromt_l, t_u]public static final int lastIndexInside(long t0,
long dt,
long t_u)
t_l, t_u]. See also Eqn. (8) in the
documentation.t0 - reference timestamp from the filedt - time interval between two consecutive samples from the filet_u - upper boundary of the time interval to read data fromt_l, t_u]public static final int firstIndexInside(double t0,
double dt,
double t_l)
t_l, t_u]. See also Eqn. (5) in the
documentation.t0 - reference timestamp from the filedt - time interval between two consecutive samples from the filet_l - lower boundary of the time interval to read data fromt_l, t_u]public static final int lastIndexInside(double t0,
double dt,
double t_u)
t_l, t_u]. See also Eqn. (6) in the
documentation.t0 - reference timestamp from the filedt - time interval between two consecutive samples from the filet_u - upper boundary of the time interval to read data fromt_l, t_u]public static final int fileOffset(int dataSize,
int index)
dataSize - size of the raw data values in bytesindex - sample index or number of samples in the filepublic static final String explainHeader(byte[] header)
header - [64] binary header bytespublic static final void writeEndianessCheckValue(ByteBuffer target)
short to the target file. This is used to check
if correct endianess is used in reading; wrong endianess would lead to
reading this as 256.target - buffer into which to write the time series datapublic static final void writeTimebase(ByteBuffer target, long t0, long dt)
target buffer.target - buffer into which to write the time series datat0 - reference timestampdt - time interval between two consecutive samplespublic static final void writeTimebase(ByteBuffer target, double t0, double dt)
target buffer.target - buffer into which to write the time series datat0 - reference timestampdt - time interval between two consecutive samplespublic static final void writeScalingDisabled(ByteBuffer target)
target buffer that tells the
reader that no scaling is available.target - buffer into which to write the time series datapublic static final void writeScaling(ByteBuffer target, byte o, byte s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeScaling(ByteBuffer target, short o, short s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeScaling(ByteBuffer target, int o, int s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeScaling(ByteBuffer target, long o, long s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeScaling(ByteBuffer target, float o, float s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeScaling(ByteBuffer target, double o, double s)
target buffer.target - buffer into which to write the time series datao - offset of the raw data valuess - scaling factor of the raw data valuespublic static final void writeReservedDummy(ByteBuffer target)
target - buffer into which to write the time series datapublic static final void writeData(ByteBuffer target, byte[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void writeData(ByteBuffer target, short[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void writeData(ByteBuffer target, int[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void writeData(ByteBuffer target, long[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void writeData(ByteBuffer target, float[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void writeData(ByteBuffer target, double[] values)
target buffer.target - buffer into which to write the time series datavalues - raw data values; all of them will be dumped into the target
bufferpublic static final void write(ByteBuffer target, Object t0, Object dt, Object rawData)
t0 and
dt and the unscaled rawData.target - buffer into which to write the time series datat0 - reference timestamp; can be double or longdt - reference timestamp; can be double or longrawData - raw data array; can be byte[], short[],
int[], long[], float[] or
double[]public static final void write(ByteBuffer target, Object t0, Object dt, Object rawData, Object scalingOffset, Object scalingFactor)
t0 and
dt and the unscaled rawData and the scaling parameters
scalingOffset and scalingFactor.target - buffer into which to write the time series datat0 - reference timestamp; can be double or
longdt - reference timestamp; can be double or
longrawData - raw data array; can be byte[], short[],
int[], long[], float[] or
double[]scalingOffset - scaling offset of the raw data to be saved into the
file; can be null, byte, short,
int, long, float or
doublescalingFactor - scaling factor of the raw data to be saved into the
file; can be null, byte, short,
int, long, float or
doublepublic static final byte[] readHeader(ByteBuffer source)
source - buffer from which to read the first 64 bytessourcepublic static final boolean readEndianessOk(ByteBuffer source)
short value from the source buffer and check
if it was correctly read as 1.source - buffer from which to readsourceRuntimeException - in any case something else than 1 or 256 was readpublic static final byte readTimeType(ByteBuffer source)
source buffer.source - buffer from which to readDTYPE_LONG or
DTYPE_DOUBLEpublic static final long readTimeT0_long(ByteBuffer source)
source buffer.source - buffer from which to readlongpublic static final long readTimeDt_long(ByteBuffer source)
source buffer.source - buffer from which to readlongpublic static final double readTimeT0_double(ByteBuffer source)
source buffer.source - buffer from which to readdoublepublic static final double readTimeDt_double(ByteBuffer source)
source buffer.source - buffer from which to readdoublepublic static final boolean hasScaling(byte scaling_dtype)
scaling_dtype - dtype byte as read from input bufferpublic static final byte readScalingType(ByteBuffer source)
source buffer.source - buffer from which to readDTYPE_NONE, DTYPE_BYTE, DTYPE_SHORT,
DTYPE_INT, DTYPE_LONG, DTYPE_FLOAT or
DTYPE_DOUBLEpublic static final void readScalingDisabled(ByteBuffer source)
source buffer over the bytes
reserved in the header for optional scaling parameters. Currently, this
simply reads 16 bytes from the buffer.source - buffer from which to readpublic static final byte readScalingOffset_byte(ByteBuffer source)
source buffer as byte
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readbytepublic static final byte readScalingFactor_byte(ByteBuffer source)
source buffer as byte
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readbytepublic static final short readScalingOffset_short(ByteBuffer source)
source buffer as short
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readshortpublic static final short readScalingFactor_short(ByteBuffer source)
source buffer as short
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readshortpublic static final int readScalingOffset_int(ByteBuffer source)
source buffer as int
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readintpublic static final int readScalingFactor_int(ByteBuffer source)
source buffer as int
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readintpublic static final long readScalingOffset_long(ByteBuffer source)
source buffer as long.source - buffer from which to readlongpublic static final long readScalingFactor_long(ByteBuffer source)
source buffer as long.source - buffer from which to readlongpublic static final float readScalingOffset_float(ByteBuffer source)
source buffer as float
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readfloatpublic static final float readScalingFactor_float(ByteBuffer source)
source buffer as float
and proceed reading until a total of 8 bytes has been read to stay aligned
with the defined file structure.source - buffer from which to readfloatpublic static final double readScalingOffset_double(ByteBuffer source)
source buffer as
double.source - buffer from which to readdoublepublic static final double readScalingFactor_double(ByteBuffer source)
source buffer as
double.source - buffer from which to readdoublepublic static final void readReservedDummy(ByteBuffer source)
source buffer over the bytes
reserved in the header. Currently, this simply reads 23 bytes from the
buffer.source - buffer from which to readpublic static final byte readDataType(ByteBuffer source)
source buffer.source - buffer from which to readDTYPE_BYTE, DTYPE_SHORT, DTYPE_INT,
DTYPE_LONG, DTYPE_FLOAT or DTYPE_DOUBLEpublic static final int readNumSamples(ByteBuffer source)
source buffer.source - buffer from which to readpublic static final void readRawData(ByteBuffer source, byte[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final void readRawData(ByteBuffer source, short[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final void readRawData(ByteBuffer source, int[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final void readRawData(ByteBuffer source, long[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final void readRawData(ByteBuffer source, float[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final void readRawData(ByteBuffer source, double[] target, int targetOffset, int numSamples)
source buffer and put them into a
given target array at an offset specified by targetOffset.source - buffer from which to readtarget - array into which to read the given samplestargetOffset - offset in target at which to put the first sample
read from the source buffernumSamples - number of samples to be read from the source
bufferpublic static final byte[] readData_byte(ByteBuffer source)
byte[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final byte[] readData_byte(ByteBuffer source, int firstDataIndex, int lastDataIndex)
byte[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final short[] readData_short(ByteBuffer source)
short[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final short[] readData_short(ByteBuffer source, int firstDataIndex, int lastDataIndex)
short[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final int[] readData_int(ByteBuffer source)
int[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final int[] readData_int(ByteBuffer source, int firstDataIndex, int lastDataIndex)
int[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final long[] readData_long(ByteBuffer source)
long[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final long[] readData_long(ByteBuffer source, int firstDataIndex, int lastDataIndex)
long[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final float[] readData_float(ByteBuffer source)
float[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final float[] readData_float(ByteBuffer source, int firstDataIndex, int lastDataIndex)
float[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final double[] readData_double(ByteBuffer source)
double[] array.source - buffer from which to readsource bufferRuntimeException - if an unknown scaling type or data type was
encounteredpublic static final double[] readData_double(ByteBuffer source, int firstDataIndex, int lastDataIndex)
double[] array.source - buffer from which to readfirstDataIndex - the index of the first sample to read from the given
bufferlastDataIndex - the index of the last sample to read from the given
buffer; -1 means read all available samplessource buffer
in the range firstDataIndex up to and including
lastDataIndexRuntimeException - if an unknown scaling type or data type was
encounteredCopyright © 2020. All rights reserved.