net.sourceforge.cobertura.instrument
Class Archive

java.lang.Object
  extended bynet.sourceforge.cobertura.instrument.Archive

class Archive
extends java.lang.Object

This class represents an archive within an archive.

Author:
John Lewis

Field Summary
private  byte[] bytes
           
private  CoberturaFile file
           
private  boolean modified
           
 
Constructor Summary
(package private) Archive(CoberturaFile file, byte[] bytes)
          Create an object that holds a buffer to an archive that is within a parent archive.
 
Method Summary
(package private)  byte[] getBytes()
          Return the contents of this archive.
(package private)  CoberturaFile getCoberturaFile()
          Returns the parent archive that contains this archive.
(package private)  java.io.InputStream getInputStream()
          Return an input stream for the contents of this archive (the child).
(package private)  boolean isModified()
          Return true if this archive has been modified (instrumented).
(package private)  void setModifiedBytes(byte[] bytes)
          Set this archive's bytes after they have been modified via instrumentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytes

private byte[] bytes

modified

private boolean modified

file

private CoberturaFile file
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

getInputStream

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

Returns:
An InputStream for the contents.

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).

isModified

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

Returns:
true if modified.

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.