Package cmp.LEDataStream

Examples of cmp.LEDataStream.LEDataOutputStream


    /**
     * Takes a shape and produces it's Well Known Binary (WKB) form.
     */
    public static byte[] writeWKB(Shape inShape){
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        LEDataOutputStream out = new LEDataOutputStream(bout);
       
        try{
            if (inShape instanceof Point) writeWKBPoint(out, (Point) inShape);
            if (inShape instanceof LineString) writeWKBLineString(out, (LineString) inShape);
            if (inShape instanceof Polygon) writeWKBPolygon(out, (Polygon) inShape);
            if (inShape instanceof MultiPoint) writeWKBMultiPoint(out, (MultiPoint) inShape);
            if (inShape instanceof MultiLineString) writeWKBMultiLineString(out, (MultiLineString) inShape);
            if (inShape instanceof MultiPolygon) writeWKBMultiPolygon(out, (MultiPolygon) inShape);
            out.flush();
        }
        catch (Exception e){
            System.out.println(e);
        }
        return bout.toByteArray();
View Full Code Here


    /**
     * Takes a shape and produces it's Well Known Binary (WKB) form.
     */
    public static byte[] writeWKB(Shape inShape){
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        LEDataOutputStream out = new LEDataOutputStream(bout);
       
        try{
            if (inShape instanceof Point) writeWKBPoint(out, (Point) inShape);
            if (inShape instanceof LineString) writeWKBLineString(out, (LineString) inShape);
            if (inShape instanceof Polygon) writeWKBPolygon(out, (Polygon) inShape);
            if (inShape instanceof MultiPoint) writeWKBMultiPoint(out, (MultiPoint) inShape);
            if (inShape instanceof MultiLineString) writeWKBMultiLineString(out, (MultiLineString) inShape);
            if (inShape instanceof MultiPolygon) writeWKBMultiPolygon(out, (MultiPolygon) inShape);
            out.flush();
        }
        catch (Exception e){
            System.out.println(e);
        }
        return bout.toByteArray();
View Full Code Here

TOP

Related Classes of cmp.LEDataStream.LEDataOutputStream

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.