Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.xml.stream.buffer
Class MutableXMLStreamBuffer

    java.lang.Object
      com.sun.xml.stream.buffer.XMLStreamBuffer
          com.sun.xml.stream.buffer.MutableXMLStreamBuffer

    public class MutableXMLStreamBuffer

extends XMLStreamBuffer

A mutable stream-based buffer of an XML infoset.

A MutableXMLStreamBuffer is created using specific SAX and StAX-based creators. Utility methods on MutableXMLStreamBuffer are provided for such functionality that utilize SAX and StAX-based creators.

Once instantiated the same instance of a MutableXMLStreamBuffer may be reused for creation to reduce the amount of Objects instantiated and garbage collected that are required for internally representing an XML infoset.

A MutableXMLStreamBuffer is not designed to be created and processed concurrently. If done so unspecified behaviour may occur.

Field Summary
`static int` | `DEFAULT_ARRAY_SIZE` The default array size for the arrays used in internal representation of the XML infoset.

Fields inherited from class com.sun.xml.stream.buffer.XMLStreamBuffer
`_contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _hasInternedStrings, _inscopeNamespaces, _structure, _structurePtr, _structureStrings, _structureStringsPtr, systemId, treeCount`

Constructor Summary
`MutableXMLStreamBuffer()` Create a new MutableXMLStreamBuffer using the `DEFAULT_ARRAY_SIZE`.
`MutableXMLStreamBuffer(int size)` Create a new MutableXMLStreamBuffer.

Method Summary
`SAXBufferCreator` | `createFromSAXBufferCreator()` Create contents of a buffer from a `SAXBufferCreator`.
`void` | `createFromXMLReader(org.xml.sax.XMLReader reader, java.io.InputStream in)` Create contents of a buffer from a `XMLReader` and `InputStream`.
`void` | `createFromXMLReader(org.xml.sax.XMLReader reader, java.io.InputStream in, java.lang.String systemId)` Create contents of a buffer from a `XMLReader` and `InputStream`.
`void` | `createFromXMLStreamReader(javax.xml.stream.XMLStreamReader reader)` Create contents of a buffer from a XMLStreamReader.
`javax.xml.stream.XMLStreamWriter` | `createFromXMLStreamWriter()` Create contents of a buffer from a XMLStreamWriter.
`void` | `reset()` Reset the MutableXMLStreamBuffer.
`protected void` | `setHasInternedStrings(boolean hasInternedStrings)`
`void` | `setSystemId(java.lang.String systemId)` Set the system identifier for this buffer.

Methods inherited from class com.sun.xml.stream.buffer.XMLStreamBuffer
`createNewBufferFromXMLReader, createNewBufferFromXMLReader, createNewBufferFromXMLStreamReader, getContentCharactersBuffer, getContentCharactersBufferPtr, getContentObjects, getContentObjectsPtr, getInscopeNamespaces, getStructure, getStructurePtr, getStructureStrings, getStructureStringsPtr, getSystemId, hasInternedStrings, isCreated, isElementFragment, isForest, isFragment, readAsXMLReader, readAsXMLReader, readAsXMLStreamReader, writeTo, writeTo, writeTo, writeTo, writeTo, writeToXMLStreamWriter, writeToXMLStreamWriter`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_ARRAY_SIZE

    public static int DEFAULT_ARRAY_SIZE

  The default array size for the arrays used in internal representation of the XML infoset.

Constructor Detail

### MutableXMLStreamBuffer

    public MutableXMLStreamBuffer()

  Create a new MutableXMLStreamBuffer using the `DEFAULT_ARRAY_SIZE`.

### MutableXMLStreamBuffer

    public MutableXMLStreamBuffer(int size)

  Create a new MutableXMLStreamBuffer.

  Parameters:
    `size` - The size of the arrays used in the internal representation of the XML infoset.
  Throws:
    `java.lang.NegativeArraySizeException` - If the `size` argument is less than `0`.

Method Detail

### setSystemId

    public void setSystemId(java.lang.String systemId)

  Set the system identifier for this buffer.

  Parameters:
    `systemId` - The system identifier.

### createFromXMLStreamReader

    public void createFromXMLStreamReader(javax.xml.stream.XMLStreamReader reader)
                                   throws javax.xml.stream.XMLStreamException

  Create contents of a buffer from a XMLStreamReader.

  The MutableXMLStreamBuffer is reset (see `reset()`) before creation.

  The MutableXMLStreamBuffer is created by consuming the events on the XMLStreamReader using an instance of `StreamReaderBufferCreator`.

  Parameters:
    `reader` - A XMLStreamReader to read from to create.
  Throws:
    `javax.xml.stream.XMLStreamException`

### createFromXMLStreamWriter

    public javax.xml.stream.XMLStreamWriter createFromXMLStreamWriter()

  Create contents of a buffer from a XMLStreamWriter.

  The MutableXMLStreamBuffer is reset (see `reset()`) before creation.

  The MutableXMLStreamBuffer is created by consuming events on a XMLStreamWriter using an instance of `StreamWriterBufferCreator`.

### createFromSAXBufferCreator

    public SAXBufferCreator createFromSAXBufferCreator()

  Create contents of a buffer from a `SAXBufferCreator`.

  The MutableXMLStreamBuffer is reset (see `reset()`) before creation.

  The MutableXMLStreamBuffer is created by consuming events from a `ContentHandler` using an instance of `SAXBufferCreator`.

  Returns:
    The `SAXBufferCreator` to create from.

### createFromXMLReader

    public void createFromXMLReader(org.xml.sax.XMLReader reader,
                                    java.io.InputStream in)
                             throws org.xml.sax.SAXException,
                                    java.io.IOException

  Create contents of a buffer from a `XMLReader` and `InputStream`.

  The MutableXMLStreamBuffer is reset (see `reset()`) before creation.

  The MutableXMLStreamBuffer is created by using an instance of `SAXBufferCreator` and registering associated handlers on the `XMLReader`.

  Parameters:
    `reader` - The `XMLReader` to use for parsing.
    `in` - The `InputStream` to be parsed.
  Throws:
    `org.xml.sax.SAXException`
    `java.io.IOException`

### createFromXMLReader

    public void createFromXMLReader(org.xml.sax.XMLReader reader,
                                    java.io.InputStream in,
                                    java.lang.String systemId)
                             throws org.xml.sax.SAXException,
                                    java.io.IOException

  Create contents of a buffer from a `XMLReader` and `InputStream`.

  The MutableXMLStreamBuffer is reset (see `reset()`) before creation.

  The MutableXMLStreamBuffer is created by using an instance of `SAXBufferCreator` and registering associated handlers on the `XMLReader`.

  Parameters:
    `reader` - The `XMLReader` to use for parsing.
    `in` - The `InputStream` to be parsed.
    `systemId` - The system ID of the input stream.
  Throws:
    `org.xml.sax.SAXException`
    `java.io.IOException`

### reset

    public void reset()

  Reset the MutableXMLStreamBuffer.

  This method will reset the MutableXMLStreamBuffer to a state of being "uncreated" similar to the state of a newly instantiated MutableXMLStreamBuffer.

  As many Objects as possible will be retained for reuse in future creation.

### setHasInternedStrings

    protected void setHasInternedStrings(boolean hasInternedStrings)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD