com.beasys.commerce.axiom.document.ref
Class  DefaultDocument
java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.ref.DefaultDocument
- All Implemented Interfaces: 
 - DocumentDef
 
- 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 | 
 
data
protected byte[] data
- The raw data.
 
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.
 
getBytes
public byte[] getBytes()
- Get the bytes of the document.
- Specified by: 
 getBytes in interface DocumentDef
 
- Following copied from interface: 
com.beasys.commerce.axiom.document.spi.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
 
- Following copied from interface: 
com.beasys.commerce.axiom.document.spi.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.
 
 
Copyright © 2001 BEA Systems, Inc. All Rights Reserved