org.exist.dom
Class BinaryDocument

java.lang.Object
  extended by org.exist.dom.NodeImpl
      extended by org.exist.dom.DocumentImpl
          extended by org.exist.dom.BinaryDocument
All Implemented Interfaces:
Comparable, QNameable, Document, Node

public class BinaryDocument
extends DocumentImpl

Represents a binary resource. Binary resources are just stored as binary data in a single overflow page. However, class BinaryDocument extends DocumentImpl and thus provides the same interface.

Author:
wolf

Field Summary
 
Fields inherited from class org.exist.dom.DocumentImpl
BINARY_FILE, LENGTH_DOCUMENT_ID, LENGTH_DOCUMENT_TYPE, UNKNOWN_DOCUMENT_ID, XML_FILE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
BinaryDocument(BrokerPool pool)
           
BinaryDocument(BrokerPool pool, Collection collection)
           
BinaryDocument(BrokerPool pool, Collection collection, XmldbURI fileURI)
           
BinaryDocument(BrokerPool pool, XmldbURI fileURI)
           
 
Method Summary
 int getContentLength()
          Returns the estimated size of the data in this document.
 long getPage()
           
 byte getResourceType()
          Returns the type of this resource, either DocumentImpl.XML_FILE or DocumentImpl.BINARY_FILE.
 void read(VariableByteInput istream)
          The method read
 void setContentLength(int length)
           
 void setPage(long page)
           
 void write(VariableByteOutputStream ostream)
          The method write
 
Methods inherited from class org.exist.dom.DocumentImpl
adoptNode, appendChild, compareDocumentPosition, compareTo, copyChildren, copyOf, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getBaseURI, getChildCount, getChildNodes, getCollection, getDocId, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getFeature, getFileURI, getFirstChild, getFirstChildAddress, getFirstChildProxy, getImplementation, getInputEncoding, getLocalName, getMetadata, getNamespaceURI, getNextSibling, getNode, getNode, getNodeType, getOwnerDocument, getParentNode, getPermissions, getPreviousSibling, getQName, getStandalone, getStrictErrorChecking, getTextContent, getUpdateLock, getURI, getUserData, getUserLock, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, insertAfter, insertBefore, isDefaultNamespace, isEqualNode, isLockedForWrite, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalizeDocument, readDocumentMeta, renameNode, setChildCount, setCollection, setDocId, setDocumentType, setDocumentURI, setEncoding, setFileURI, setMetadata, setOwnerDocument, setPermissions, setPermissions, setPermissions, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserLock, setVersion, setXmlStandalone, setXmlVersion, toString, triggerDefrag, updateChild
 
Methods inherited from class org.exist.dom.NodeImpl
appendChild, appendChildren, cloneNode, getAttributes, getAttributesCount, getLastChild, getNodeName, getNodeValue, getPrefix, hasAttributes, hasChildNodes, insertAfter, insertAfter, insertBefore, insertBefore, normalize, removeChild, removeChild, replaceChild, replaceChild, setAttributes, setNodeName, setNodeValue, setPrefix, supports, updateChild
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getLastChild, getNodeName, getNodeValue, getPrefix, hasAttributes, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

BinaryDocument

public BinaryDocument(BrokerPool pool)

BinaryDocument

public BinaryDocument(BrokerPool pool,
                      Collection collection)

BinaryDocument

public BinaryDocument(BrokerPool pool,
                      XmldbURI fileURI)

BinaryDocument

public BinaryDocument(BrokerPool pool,
                      Collection collection,
                      XmldbURI fileURI)
Method Detail

getResourceType

public byte getResourceType()
Description copied from class: DocumentImpl
Returns the type of this resource, either DocumentImpl.XML_FILE or DocumentImpl.BINARY_FILE.

Overrides:
getResourceType in class DocumentImpl

setPage

public void setPage(long page)

getPage

public long getPage()

getContentLength

public int getContentLength()
Description copied from class: DocumentImpl
Returns the estimated size of the data in this document. As an estimation, the number of pages occupied by the document is multiplied with the current page size.

Overrides:
getContentLength in class DocumentImpl

setContentLength

public void setContentLength(int length)

write

public void write(VariableByteOutputStream ostream)
           throws IOException
Description copied from class: DocumentImpl
The method write

Overrides:
write in class DocumentImpl
Parameters:
ostream - a VariableByteOutputStream value
Throws:
IOException - if an error occurs

read

public void read(VariableByteInput istream)
          throws IOException,
                 EOFException
Description copied from class: DocumentImpl
The method read

Overrides:
read in class DocumentImpl
Parameters:
istream - a VariableByteInput value
Throws:
IOException - if an error occurs
EOFException - if an error occurs


Copyright (C) Wolfgang Meier. All rights reserved.