FileDocCategorySizeDatePackage
DocumentDescriptor.javaAPI DocApache Poi 3.0.12763Mon Jan 01 12:39:34 GMT 2007org.apache.poi.contrib.poibrowser

DocumentDescriptor

public class DocumentDescriptor extends Object

Describes the most important (whatever that is) features of a {@link POIFSDocument}.

author
Rainer Klute (klute@rainer-klute.de)
version
$Id: DocumentDescriptor.java 489730 2006-12-22 19:18:16Z bayard $
since
2002-02-05 *
author
Rainer Klute <klute@rainer-klute.de>

Fields Summary
String
name
POIFSDocumentPath
path
DocumentInputStream
stream
int
size
byte[]
bytes
Constructors Summary
public DocumentDescriptor(String name, POIFSDocumentPath path, DocumentInputStream stream, int nrOfBytes)

Creates a {@link DocumentDescriptor}.

param
name The stream's name.
param
path The stream's path in the POI filesystem hierarchy.
param
stream The stream.
param
nrOfBytes The maximum number of bytes to display in a dump starting at the beginning of the stream.

        this.name = name;
        this.path = path;
        this.stream = stream;
        try
        {
            size = stream.available();
            if (stream.markSupported())
            {
                stream.mark(nrOfBytes);
                final byte[] b = new byte[nrOfBytes];
                final int read = stream.read(b, 0, Math.min(size, b.length));
                bytes = new byte[read];
                System.arraycopy(b, 0, bytes, 0, read);
                stream.reset();
            }
        }
        catch (IOException ex)
        {
            System.out.println(ex);
        }
    
Methods Summary