DefaultDocument Class

DEPRECATED

com.bea.p13n.content.document.ref
DefaultDocument Class

public class DefaultDocument

    extends Object
    implements com.bea.p13n.content.document.spi.DocumentDef

A concreate DocumentDef that takes an array of bytes.


Hierarchy
Object
  DefaultDocument
All Implemented Interfaces

com.bea.p13n.content.document.spi.DocumentDef

Field Summary

protected byte
data
The raw data.
 

Constructor Summary

DefaultDocument(byte data)

Constructor from a byte array.
DefaultDocument(InputStream in)

Constructor from an input stream.
 

Method Summary

public static void
close(InputStream in)
Close an input stream and ignore any exception.
public byte[]
getBytes()
Get the bytes of the document.
public InputStream
openStream()
Open an input stream to the bytes of the document.
public static byte[]
readFully(InputStream in)
Fully read an input stream and return the resulting bytes.
public void
setBytes(byte[] data)
Set the bytes of the document.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.p13n.content.document.spi.com.bea.p13n.content.document.spi.DocumentDef
getBytes, openStream
 

Field Detail

data

protected byte data
The raw data.

 

Constructor Detail

DefaultDocument

public DefaultDocument(byte[] data)
Constructor from a byte array.

DefaultDocument

public DefaultDocument(InputStream in)
Constructor from an input stream.
 

Method Detail

close(InputStream) Method

public static void close(InputStream in)
Close an input stream and ignore any exception.


getBytes() Method

public byte[] getBytes()
Get the bytes of the document.

Returns

the raw bytes of the document.

openStream() Method

public InputStream openStream()
throws DocumentException
Open an input stream to the bytes of the document.

Returns

an input stream to the bytes.

Exceptions

DocumentException

readFully(InputStream) Method

public static byte[] readFully(InputStream in)
throws IOException
Fully read an input stream and return the resulting bytes.

Exceptions

IOException

setBytes(byte[]) Method

public void setBytes(byte[] data)
Set the bytes of the document.