Class Overview
Since JDK does not come with UTF-32/UCS-4, let's implement a simple
decoder to use.
Summary
[Expand]
Inherited Fields |
From class
java.io.Reader
|
Public Methods |
void
|
close()
|
final
void
|
freeBuffers()
This method should be called along with (or instead of) normal
close.
|
int
|
read()
Although this method is implemented by the base class, AND it should
never be called by main code, let's still implement it bit more
efficiently just in case
|
int
|
read(char[] cbuf, int start, int len)
|
[Expand]
Inherited Methods |
From class
java.io.Reader
abstract
void
|
close()
|
void
|
mark(int arg0)
|
boolean
|
markSupported()
|
int
|
read()
|
abstract
int
|
read(char[] arg0, int arg1, int arg2)
|
int
|
read(CharBuffer arg0)
|
int
|
read(char[] arg0)
|
boolean
|
ready()
|
void
|
reset()
|
long
|
skip(long arg0)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
java.io.Closeable
|
From interface
java.lang.AutoCloseable
|
From interface
java.lang.Readable
abstract
int
|
read(CharBuffer arg0)
|
|
Constants
protected
static
final
int
LAST_VALID_UNICODE_CHAR
JSON actually limits available Unicode range in the high end
to the same as xml (to basically limit UTF-8 max byte sequence
length to 4)
Constant Value:
1114111
(0x0010ffff)
protected
static
final
char
NULL_BYTE
Constant Value:
0
(0x00000000)
protected
static
final
char
NULL_CHAR
Constant Value:
0
(0x00000000)
Fields
Public Constructors
public
UTF32Reader
(IOContext ctxt, InputStream in, byte[] buf, int ptr, int len, boolean isBigEndian)
Public Methods
public
final
void
freeBuffers
()
This method should be called along with (or instead of) normal
close. After calling this method, no further reads should be tried.
Method will try to recycle read buffers (if any).
public
int
read
()
Although this method is implemented by the base class, AND it should
never be called by main code, let's still implement it bit more
efficiently just in case
public
int
read
(char[] cbuf, int start, int len)
Protected Methods
protected
void
reportBounds
(char[] cbuf, int start, int len)
protected
void
reportStrangeStream
()