BEA Systems, Inc.

com.beasys.commerce.axiom.document.ref
Class DefaultDocument

java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.ref.DefaultDocument

public class DefaultDocument
extends java.lang.Object
implements DocumentDef

A concreate DocumentDef that takes an array of bytes.


Field Summary
protected  byte[] data
          The raw data.
 
Constructor Summary
DefaultDocument(byte[] data)
          Constructor from a byte array.
DefaultDocument(java.io.InputStream in)
          Constructor from an input stream.
 
Method Summary
static void close(java.io.InputStream in)
          Close an input stream and ignore any exception.
 byte[] getBytes()
          Get the bytes of the document.
 java.io.InputStream openStream()
          Open an input stream to the bytes of the document.
static byte[] readFully(java.io.InputStream in)
          Fully read an input stream and return the resulting bytes.
 void setBytes(byte[] data)
          Set the bytes of the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data
The raw data.
Constructor Detail

DefaultDocument

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

DefaultDocument

public DefaultDocument(java.io.InputStream in)
                throws java.io.IOException
Constructor from an input stream.
Method Detail

getBytes

public byte[] getBytes()
Get the bytes of the document.
Specified by:
getBytes in interface DocumentDef
Tags copied from interface: DocumentDef
Returns:
the raw bytes of the document.
Throws:
DocumentException - thrown on an error.

setBytes

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

openStream

public java.io.InputStream openStream()
                               throws DocumentException
Open an input stream to the bytes of the document.
Specified by:
openStream in interface DocumentDef
Tags copied from interface: DocumentDef
Returns:
an input stream to the bytes.
Throws:
DocumentException - thrown on an error.

readFully

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

close

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

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved