public class JsonArrayFixingInputStream
extends java.io.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.
| Constructor and Description |
|---|
JsonArrayFixingInputStream(java.io.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() |
protected boolean |
isWhiteSpace(byte c)
Tests if the byte passed in is a white space character.
|
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
public JsonArrayFixingInputStream(java.io.InputStream in)
in - the InputStream containing the poorly formed JSON arraypublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreamprotected boolean isWhiteSpace(byte c)
c - the byte representing the character to testtrue if the byte is white space; otherwise
falseCopyright© 2012-21 Jeremy Long. All Rights Reserved.