public class JsonArrayFixingInputStream extends InputStream
go list -json -m all.
Example:
{ "name1": "value" }
{ "name2" : "value" }
Would be transformed into:
[{ "name1": "value" },
{ "name2" : "value" }]
Note that this is a naive implementation and will incorrectly transform a stream if there are '}' contained within the names of values.
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
in
The input stream to be filtered.
|
| Constructor and Description |
|---|
JsonArrayFixingInputStream(InputStream in)
Constructs a new filtering input stream used to fix a poorly formatted
JSON array.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
mark, resetprotected volatile InputStream in
public JsonArrayFixingInputStream(InputStream in)
in - the InputStream containing the poorly formed JSON arraypublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamCopyright © 2012–2020 OWASP. All rights reserved.