public class BytesReader extends AbstractBlobReader
Use a ByteBuffer to store the blob's bytes This class extends AbstractBlobReader.
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
_bbByteBuffer
the data
|
protected int |
_blobSize
size of the Blob
|
protected DataEncoding |
_firstDataEncondig |
_dataEncodingBySpectrumId, _peaksCounts, _spectraCount, _spectrumHeaderById, _spectrumSliceStartPositions, logger| Constructor and Description |
|---|
BytesReader(byte[] bytes,
long firstSpectrumId,
long lastSpectrumId,
Map<Long,SpectrumHeader> spectrumHeaderById,
Map<Long,DataEncoding> dataEncodingBySpectrumId)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_indexSpectrumSlices(int estimatedSpectraCount)
Do a first parse of the blob to determine beginning index of each spectrum slice
|
void |
disposeBlob()
Cleanup the blob if necessary
|
int |
getBlobSize() |
int |
getSpectraCount() |
long |
getSpectrumIdAt(int idx) |
SpectrumData |
readFilteredSpectrumSliceDataAt(int idx,
double minMz,
double maxMz) |
SpectrumSlice |
readSpectrumSliceAt(int idx) |
SpectrumData |
readSpectrumSliceDataAt(int idx) |
checkDataEncodingIsNotNull, checkSpectrumIndexRange, getAllSpectrumIds, readAllSpectrumSlices, readSpectrumSliceDataprotected ByteBuffer _bbByteBuffer
protected int _blobSize
protected DataEncoding _firstDataEncondig
public BytesReader(byte[] bytes,
long firstSpectrumId,
long lastSpectrumId,
Map<Long,SpectrumHeader> spectrumHeaderById,
Map<Long,DataEncoding> dataEncodingBySpectrumId)
throws StreamCorruptedException
dataEncodings, - DataEncoding object for each spectrum, usually given by a mzDbReaderInstancedata, - array of byte of the blobStreamCorruptedExceptionMzDbReader,
DataEncodingprotected void _indexSpectrumSlices(int estimatedSpectraCount)
throws StreamCorruptedException
StreamCorruptedExceptionAbstractBlobReader,
AbstractBlobReader._buildMpaPositions()public void disposeBlob()
IBlobReaderIBlobReader.disposeBlob()public int getBlobSize()
IBlobReader#getBlobSize()public int getSpectraCount()
IBlobReader.getSpectraCount()public long getSpectrumIdAt(int idx)
idx - index of spectrum starting at 1IBlobReader#idOfSpectrumAt(int)public SpectrumSlice readSpectrumSliceAt(int idx)
idx - index of specified spectrumIBlobReader.readSpectrumSliceAt(int)public SpectrumData readSpectrumSliceDataAt(int idx)
idx - index of specified spectrumIBlobReader.readSpectrumSliceAt(int)public SpectrumData readFilteredSpectrumSliceDataAt(int idx, double minMz, double maxMz)
idx - index of specified spectrumCopyright © 2019. All rights reserved.