Package overit.geocall.util.services
Class Streamer
java.lang.Object
overit.geocall.util.services.Streamer
Utility class used to serialize and write an object in an output channel.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the encodingvoidout(byte[] bb, OutputStream os) Write the array of bytes in the output streamvoidout(JsonNode jn, OutputStream os) Write the JsonNode in the output streamvoidout(com.google.gson.JsonElement je, OutputStream os) Write the JsonElement in the output streamvoidout(SOAPMessage sm, OutputStream os) Write the SOAPMessage in the output streamvoidout(InputStream is, OutputStream os) Write the InputStream in the output streamvoidout(Object obj, OutputStream os) Write the object in the output streamvoidout(String s, OutputStream os) Write the String in the output streamvoidout(Throwable e, OutputStream os) Write the Throwable in the output streamprotected voidout(Element el, OutputStream os) Write the Element in the output streamvoidout(ByteCache bc, OutputStream os) Write the ByteCache in the output streamvoidout(XMLTree x, OutputStream os) Write the Tree in the output streamvoidsetBytesMode(boolean fullBytes, String contentType) Sets bytes modevoidsetEncoding(String encoding) Sets the encodingvoidsetIndent(int indent) Sets the indendt Default value is 4voidsetXmlMode(String proceduralInstruction) Sets the XML mode
-
Field Details
-
_encoding
-
_indent
protected int _indent -
_xmlProceduralInstruction
-
_bytesFull
protected boolean _bytesFull -
_bytesContentType
-
-
Constructor Details
-
Streamer
public Streamer()
-
-
Method Details
-
setEncoding
Sets the encoding- Parameters:
encoding- String representing the encoding
-
getEncoding
Returns the encoding- Returns:
- A string representing the encoding
-
setIndent
public void setIndent(int indent) Sets the indendt Default value is 4- Parameters:
indent- The indent to set
-
setXmlMode
Sets the XML mode- Parameters:
proceduralInstruction- String representing the procedural instruction
-
setBytesMode
Sets bytes mode- Parameters:
fullBytes- Boolean indicating if full bytes is enabled or notcontentType- The bytes content type
-
out
Write the object in the output stream- Parameters:
obj- The object to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the Tree in the output stream- Parameters:
x- The XMLTree to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the SOAPMessage in the output stream- Parameters:
sm- The SOAPMessage to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the JsonElement in the output stream- Parameters:
je- The JsonElement to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the JsonNode in the output stream- Parameters:
jn- The JsonNode to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the String in the output stream- Parameters:
s- The String to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the ByteCache in the output stream- Parameters:
bc- The ByteCache to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the InputStream in the output stream- Parameters:
is- The InputStream to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the array of bytes in the output stream- Parameters:
bb- The array of bytes to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the Element in the output stream- Parameters:
el- The Element to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-
out
Write the Throwable in the output stream- Parameters:
e- The Throwable to writeos- The OutputStream- Throws:
IOException- if an i/o error occurs
-