Package org.geotools.caching.util

Examples of org.geotools.caching.util.SimpleFeatureMarshaller


     */
    public void testMarshall()
        throws IOException, ClassNotFoundException, IllegalAttributeException {
        Generator gen = new Generator(1000, 1000);
        SimpleFeature f = gen.createFeature(0);
        SimpleFeatureMarshaller m = new SimpleFeatureMarshaller();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        m.marshall(f, oos);

        byte[] ba = baos.toByteArray();
        baos.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(ba);
        ObjectInputStream ois = new ObjectInputStream(bais);
        Feature newf = m.unmarshall(ois);
        bais.close();
        assertTrue(f.equals(newf));
    }
View Full Code Here


     */
    public void ztestComplexMarshall()
        throws IOException, ClassNotFoundException, IllegalAttributeException {
        Generator gen = new Generator(1000, 1000);
        SimpleFeature f = gen.createFeature(0);
        SimpleFeatureMarshaller m = new SimpleFeatureMarshaller();
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        m.marshall(f, oos);

        byte[] ba = baos.toByteArray();
        baos.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(ba);
        ObjectInputStream ois = new ObjectInputStream(bais);
        Feature newf = m.unmarshall(ois);
        bais.close();
        //newf = ((DefaultFeature) newf).toComplex() ;
        assertTrue(f.equals(newf));
    }
View Full Code Here

        long start = System.currentTimeMillis();

        for (int i = 0; i < 10000; i++) {
            SimpleFeature f = (SimpleFeature) features.get(i);
            SimpleFeatureMarshaller marsh = new SimpleFeatureMarshaller();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();

            try {
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                marsh.marshall(f, oos);

                byte[] ba = baos.toByteArray();
                ByteArrayInputStream bais = new ByteArrayInputStream(ba);
                ObjectInputStream ois = new ObjectInputStream(bais);
                Feature newf = marsh.unmarshall(ois);

                if (!newf.equals(f)) {
                    throw new RuntimeException("Error at unmarshall");
                }
View Full Code Here

TOP

Related Classes of org.geotools.caching.util.SimpleFeatureMarshaller

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.