public class XMLDecoder extends Object
XMLDecoder reads objects from xml created by
XMLEncoder.
The API is similar to ObjectInputStream.
| Constructor and Description |
|---|
XMLDecoder(InputStream inputStream)
Create a decoder to read from specified input stream.
|
XMLDecoder(InputStream inputStream,
Object owner)
Create a decoder to read from specified input stream.
|
XMLDecoder(InputStream inputStream,
Object owner,
ExceptionListener listener)
Create a decoder to read from specified input stream.
|
XMLDecoder(InputStream inputStream,
Object owner,
ExceptionListener listener,
ClassLoader cl) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the input stream of xml data.
|
ExceptionListener |
getExceptionListener()
Returns the exception listener.
|
Object |
getOwner()
Returns the owner of this decoder.
|
Object |
readObject()
Reads the next object.
|
void |
setExceptionListener(ExceptionListener listener)
Sets the exception listener.
|
void |
setOwner(Object owner)
Sets the owner of this decoder.
|
public XMLDecoder(InputStream inputStream)
inputStream - an input stream of xmlpublic XMLDecoder(InputStream inputStream, Object owner)
inputStream - an input stream of xmlowner - the owner of this decoderpublic XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener)
inputStream - an input stream of xmlowner - the owner of this decoderlistener - listen to the exceptions thrown by the decoderpublic XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl)
public void close()
public ExceptionListener getExceptionListener()
public Object getOwner()
public Object readObject()
ArrayIndexOutOfBoundsException - if no more objects to readpublic void setExceptionListener(ExceptionListener listener)
listener - an exception listenerpublic void setOwner(Object owner)
owner - the owner of this decoderCopyright © 2015. All Rights Reserved.