|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader com.ibm.portal.streaming.json.JsonParserReader.Entry
public abstract static class JsonParserReader.Entry
Represents an entry in this input stream. The stream representation of the entry will close the entry but not the complete stream. Depending on the type of the entry, the read method represent the content:
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
JsonParserReader.Entry()
|
Method Summary | |
---|---|
abstract void |
close()
Closes this entry, subsequent attempts to read from this reader will fail. |
abstract java.io.InputStream |
getInputStream()
Returns an InputStream that reads the entry as bytes. |
abstract JsonParserReader.TYPE |
getType()
Returns the type of this entry |
abstract int |
read(java.io.Writer dst)
Reads the value of the entry and copies it into the target writer. |
abstract void |
readFully(byte[] b,
int off,
int len)
Reads the number of bytes from a base64 encoded entry |
abstract java.lang.Number |
readNumber()
Reads a number or null if the entry does not contain
data. |
abstract java.lang.String |
readString()
Reads a string or null if the entry does not contain
data. |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.utilities.streams.Writable |
---|
write |
Methods inherited from interface com.ibm.utilities.streams.Streamable |
---|
write |
Methods inherited from interface java.io.DataInput |
---|
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
Methods inherited from interface java.nio.channels.Channel |
---|
isOpen |
Constructor Detail |
---|
public JsonParserReader.Entry()
Method Detail |
---|
public abstract void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.nio.channels.Channel
close
in class java.io.Reader
java.io.IOException
- if an I/O error has occurredpublic abstract java.io.InputStream getInputStream() throws java.io.IOException
InputStream
that reads the entry as bytes. The
bytes depend on the content type:
DataOutputStream
would generate a
byte sequence.
null
if the entry is closed
java.io.IOException
- if an I/O error has occurredpublic abstract JsonParserReader.TYPE getType()
null
public abstract int read(java.io.Writer dst) throws java.io.IOException
dst
- target writer, not null
java.io.IOException
- - if the data could not be read or copiedpublic abstract void readFully(byte[] b, int off, int len) throws java.io.IOException
readFully
in interface java.io.DataInput
b
- target byte buffer, not null
off
- index into the bufferlen
- length of the target buffer, must be >0
java.io.IOException
- if an I/O error has occurredpublic abstract java.lang.Number readNumber() throws java.io.IOException, java.lang.NumberFormatException
null
if the entry does not contain
data. The number type is detected automatically. Reading a number on
an entry of type START_STRING tries to parse the string to a number.
null
if no number exists
java.io.IOException
- if an I/O error has occurred
java.lang.NumberFormatException
- if the number cannot be decoded from the stringpublic abstract java.lang.String readString() throws java.io.IOException
null
if the entry does not contain
data. Reading a string for a number entry converts the number into a
string.
null
if no string exists
java.io.IOException
- if an I/O error has occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |