Package gri.data.serializers.text

Examples of gri.data.serializers.text.TextSerializer


        //write element:
        Element nameElem = Util.createElement("name", file.getName());
       
        Element contentElem = new Element("content");
        contentElem.setAttribute("encoding", defaultEncoding);
        TextSerializer encoder = getEncoder(defaultEncoding);
        contentElem.setText(encoder.write(content))
             
        elem.addContent(nameElem);
        elem.addContent(contentElem);
    }
View Full Code Here


            else if (name.equals("content")) {
                String encoding = child.getAttributeValue("encoding");
                if (encoding == null)
                    encoding = this.defaultEncoding;
               
                TextSerializer encoder = getEncoder(encoding);
                try {
                    byte [] content = (byte [])encoder.read(child.getText());
                    memFile.setContent(content);
                }
                catch(ParseException e) {
                    throw new IOException(e.getMessage());
                }
View Full Code Here

TOP

Related Classes of gri.data.serializers.text.TextSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.