net.sourceforge.cobertura.instrument

Class Archive

class Archive extends Object

This class represents an archive within an archive.

Author: John Lewis

Field Summary
byte[]bytes
CoberturaFilefile
booleanmodified
Constructor Summary
Archive(CoberturaFile file, byte[] bytes)
Create an object that holds a buffer to an archive that is within a parent archive.
Method Summary
byte[]getBytes()
Return the contents of this archive.
CoberturaFilegetCoberturaFile()
Returns the parent archive that contains this archive.
InputStreamgetInputStream()
Return an input stream for the contents of this archive (the child).
booleanisModified()
Return true if this archive has been modified (instrumented).
voidsetModifiedBytes(byte[] bytes)
Set this archive's bytes after they have been modified via instrumentation.

Field Detail

bytes

private byte[] bytes

file

private CoberturaFile file

modified

private boolean modified

Constructor Detail

Archive

Archive(CoberturaFile file, byte[] bytes)
Create an object that holds a buffer to an archive that is within a parent archive.

Parameters: file The parent archive on the hard drive that holds the child archive. bytes The contents of the child archive.

Method Detail

getBytes

byte[] getBytes()
Return the contents of this archive.

Returns: A byte array with the contents of this archive.

getCoberturaFile

CoberturaFile getCoberturaFile()
Returns the parent archive that contains this archive.

Returns: A CoberturaFile representing the parent archive.

getInputStream

InputStream getInputStream()
Return an input stream for the contents of this archive (the child).

Returns: An InputStream for the contents.

isModified

boolean isModified()
Return true if this archive has been modified (instrumented).

Returns: true if modified.

setModifiedBytes

void setModifiedBytes(byte[] bytes)
Set this archive's bytes after they have been modified via instrumentation.

Parameters: bytes The new contents of the archive (instrumented).