@Beta public abstract class AbstractXmlHttpContent extends AbstractHttpContent
Beta
Implementation is not thread-safe.
Modifier | Constructor and Description |
---|---|
protected |
AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary) |
Modifier and Type | Method and Description |
---|---|
XmlNamespaceDictionary |
getNamespaceDictionary()
Returns the XML namespace dictionary.
|
AbstractXmlHttpContent |
setMediaType(HttpMediaType mediaType)
Sets the media type to use for the Content-Type header, or
null if unspecified. |
void |
writeTo(OutputStream out)
Writes the byte content to the given output stream.
|
protected abstract void |
writeTo(org.xmlpull.v1.XmlSerializer serializer)
Writes the content to the given XML serializer.
|
computeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupported
protected AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary)
namespaceDictionary
- XML namespace dictionarypublic final void writeTo(OutputStream out) throws IOException
StreamingContent
Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.
out
- output streamIOException
public AbstractXmlHttpContent setMediaType(HttpMediaType mediaType)
AbstractHttpContent
null
if unspecified.
This will also overwrite any previously set parameter of the media type (for example "charset"
), and therefore might change other properties as well.
setMediaType
in class AbstractHttpContent
public final XmlNamespaceDictionary getNamespaceDictionary()
protected abstract void writeTo(org.xmlpull.v1.XmlSerializer serializer) throws IOException
IOException
- I/O exceptionCopyright © 2011–2019 Google. All rights reserved.