Example usage for java.beans XMLDecoder XMLDecoder

List of usage examples for java.beans XMLDecoder XMLDecoder

Introduction

In this page you can find the example usage for java.beans XMLDecoder XMLDecoder.

Prototype

public XMLDecoder(InputSource is) 

Source Link

Document

Creates a new decoder to parse XML archives created by the XMLEncoder class.

Usage

From source file:com.projity.pm.graphic.frames.GraphicManager.java

/**
 * Decode the current workspace (currently using XML though could be binary)
 * @return workspace object decoded from lastWorkspace static
 *//*from  ww w .j a  v a2  s.  co m*/
private Workspace decodeWorkspaceXML() {
    ByteArrayInputStream stream = new ByteArrayInputStream(((String) lastWorkspace).getBytes());
    XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(stream));
    Workspace workspace = (Workspace) decoder.readObject();
    decoder.close();
    return workspace;
}