public class SampleBatch extends Object implements ReadWriteableBinary
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
HEADER
Header for SampleBatch files
|
| Constructor and Description |
|---|
SampleBatch()
Default constructor
|
SampleBatch(FileType type,
File sampleSource,
int startIndex,
int endIndex)
Default constructor
|
SampleBatch(FileType type,
File sampleSource,
int startIndex,
int endIndex,
int[] relativeIndexList)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
binaryHeader()
Header for binary input.
|
boolean |
equals(Object o) |
int |
getEndIndex() |
int[] |
getRelativeIndexList() |
int |
getStartIndex() |
byte[][] |
getStoredSamples() |
byte[][] |
getStoredSamples(int[] indices)
Get the stored samples
|
byte[][] |
getStoredSamples(int interestedStart,
int interestedEnd)
Get the stored samples
|
void |
readBinary(DataInput in)
Read internal state from in.
|
static List<SampleBatch> |
readSampleBatches(File sampleBatchOut)
Read batches from a file
|
String |
toString() |
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
static void |
writeSampleBatches(List<SampleBatch> sampleBatches,
File sampleBatchOut)
Write batches to a file
|
public static final byte[] HEADER
public SampleBatch()
public SampleBatch(FileType type, File sampleSource, int startIndex, int endIndex, int[] relativeIndexList)
type - sampleSource - startIndex - endIndex - relativeIndexList - public SampleBatch(FileType type, File sampleSource, int startIndex, int endIndex)
type - sampleSource - startIndex - endIndex - public byte[][] getStoredSamples() throws IOException
IOExceptionpublic byte[][] getStoredSamples(int[] indices) throws IOException
indices - IOExceptionpublic byte[][] getStoredSamples(int interestedStart, int interestedEnd) throws IOException
interestedStart - interestedEnd - IOExceptionpublic int getStartIndex()
public int getEndIndex()
public static void writeSampleBatches(List<SampleBatch> sampleBatches, File sampleBatchOut)
sampleBatches - sampleBatchOut - public static List<SampleBatch> readSampleBatches(File sampleBatchOut)
sampleBatchOut - public int[] getRelativeIndexList()
public void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinaryout - sink to write toIOException - an error writing to outpublic void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinary