Class ByteArrayXmlStreamReader
java.lang.Object
javax.xml.stream.util.StreamReaderDelegate
io.micronaut.xml.jackson.server.convert.ByteArrayXmlStreamReader
- All Implemented Interfaces:
AutoCloseable
,XMLStreamConstants
,XMLStreamReader
@Internal
public final class ByteArrayXmlStreamReader
extends StreamReaderDelegate
implements AutoCloseable
Stream reader that pairs xml stream with underlying byte array.
- Since:
- 1.0.0
- Author:
- Sergey Vishnyakov
-
Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
-
Constructor Summary
-
Method Summary
Methods inherited from class javax.xml.stream.util.StreamReaderDelegate
close, getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getElementText, getEncoding, getEventType, getLocalName, getLocation, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getParent, getPIData, getPITarget, getPrefix, getProperty, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEndElement, isStandalone, isStartElement, isWhiteSpace, next, nextTag, require, setParent, standaloneSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.AutoCloseable
close
-
Constructor Details
-
ByteArrayXmlStreamReader
- Parameters:
bytes
- raw representation of xml- Throws:
XMLStreamException
- if byte array represents corrupted xml
-
-
Method Details
-
reset
The xmlStream is stateful. Once we walked through the whole stream, before we can re-read its content we need to reset state. Unfortunately the stream implementation does not have an api to flush the state, so a simple solution is to create a new instance with the same underlying byte array.- Returns:
- new instance with fresh state
-