public abstract class Chunk extends Object
| Modifier and Type | Field and Description |
|---|---|
protected DataInputStream |
_dstream |
protected ModuleBase |
_module |
protected long |
bytesLeft |
protected long |
chunkOffset |
protected long |
chunkSize |
static int |
HEADER_LENGTH
Length of chunk headers in bytes
|
static int |
ID_LENGTH
Length of chunk ID fields in bytes
|
static int |
SIZE_LENGTH
Length of chunk size fields in bytes
|
| Constructor and Description |
|---|
Chunk(ModuleBase module,
ChunkHeader hdr,
DataInputStream dstrm)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
byteBufString(byte[] byteArray)
Converts a byte buffer cleanly into an ASCII string.
|
abstract boolean |
readChunk(RepInfo info)
Reads a chunk and puts appropriate information into the RepInfo object.
|
public static final int ID_LENGTH
public static final int SIZE_LENGTH
public static final int HEADER_LENGTH
protected ModuleBase _module
protected DataInputStream _dstream
protected long bytesLeft
protected long chunkSize
protected long chunkOffset
public Chunk(ModuleBase module, ChunkHeader hdr, DataInputStream dstrm)
module - The Module under which this was calledhdr - The header for this chunkdstrm - The stream from which the data are being readpublic abstract boolean readChunk(RepInfo info) throws IOException
info - RepInfo object to receive informationfalse if the chunk is structurally
invalid, otherwise trueIOExceptionprotected String byteBufString(byte[] byteArray)
Copyright © 2008–2021 The Open Preservation Foundation. All rights reserved.