public class DocumentBlock extends BigBlock
Modifier and Type | Field and Description |
---|---|
private int |
_bytes_read |
private static byte |
_default_value |
private int |
blockSize |
private long |
offset |
Modifier | Constructor and Description |
---|---|
private |
DocumentBlock(int size)
Create a single instance initialized with default values
|
|
DocumentBlock(RandomAccessInputStream stream,
int size)
Create a single instance initialized with data.
|
|
DocumentBlock(RawDataBlock block,
int size)
create a document block from a raw data block
|
Modifier and Type | Method and Description |
---|---|
static DocumentBlock[] |
convert(long offset,
RandomAccessInputStream stream,
int numBytes,
int size,
int blockSize)
convert a single long array into an array of DocumentBlock
instances
|
int |
getBigBlockSize() |
static byte |
getFillByte() |
boolean |
partiallyRead()
Was this a partially read block?
|
static void |
read(DocumentBlock[] blocks,
byte[] buffer,
int offset,
int blockSize,
RandomAccessInputStream stream)
read data from an array of DocumentBlocks
|
int |
size()
Get the number of bytes read for this block
|
(package private) void |
writeData(OutputStream stream)
Write the block's data to an OutputStream
|
doWriteData, writeBlocks
private static final byte _default_value
private int _bytes_read
private int blockSize
private long offset
public DocumentBlock(RawDataBlock block, int size) throws IOException
block
- the raw data blocksize
- the block sizeIOException
public DocumentBlock(RandomAccessInputStream stream, int size) throws IOException
stream
- the InputStream delivering the data.IOException
private DocumentBlock(int size)
public int size()
public int getBigBlockSize()
getBigBlockSize
in class BigBlock
public boolean partiallyRead()
public static byte getFillByte()
public static DocumentBlock[] convert(long offset, RandomAccessInputStream stream, int numBytes, int size, int blockSize)
offset
- the offset into the array of blocks to read fromstream
- the RandomAccessInputStream
to read fromsize
- the intended size of the array (which may be smaller)numBytes
- the number of bytesblockSize
- the size of a big blockpublic static void read(DocumentBlock[] blocks, byte[] buffer, int offset, int blockSize, RandomAccessInputStream stream)
blocks
- the blocks to read frombuffer
- the buffer to write the data intooffset
- the offset into the array of blocks to read fromvoid writeData(OutputStream stream) throws IOException
writeData
in class BigBlock
stream
- the OutputStream to which the stored data should
be writtenIOException
- on problems writing to the specified
streamCopyright © 2015 Open Microscopy Environment