@ThreadSafe public interface ArrayWriter
Array
instances to a variety of output forms.Modifier and Type | Method and Description |
---|---|
static ArrayWriter |
defaultWriter()
Get the default ArrayWriter instance.
|
static ArrayWriter |
prettyWriter()
Get the default ArrayWriter instance that outputs nicely-formatted JSON arrays.
|
String |
write(Array array)
Write the supplied array to a string using UTF-8.
|
void |
write(Array array,
OutputStream jsonStream)
Write the supplied array to bytes using UTF-8.
|
void |
write(Array array,
Writer jsonWriter)
Write the supplied array to bytes using UTF-8.
|
default byte[] |
writeAsBytes(Array array)
Write the supplied array to bytes using UTF-8.
|
static ArrayWriter defaultWriter()
static ArrayWriter prettyWriter()
default byte[] writeAsBytes(Array array)
array
- the array to be written; may not be nullvoid write(Array array, OutputStream jsonStream) throws IOException
array
- the array to be written; may not be nulljsonStream
- the stream to which the array is to be written; may not be nullIOException
- if an array could not be written to the supplied streamvoid write(Array array, Writer jsonWriter) throws IOException
array
- the array to be written; may not be nulljsonWriter
- the IO writer to which the array is to be written; may not be nullIOException
- if an array could not be written to the supplied streamString write(Array array) throws IOException
array
- the array to be written; may not be nullIOException
- if an array could not be written to the supplied streamCopyright © 2016 JBoss by Red Hat. All rights reserved.