⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 speedstrategy.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
字号:
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory.
 */
package org.vfny.geoserver.servlets;

import org.geoserver.ows.ServiceStrategy;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.http.HttpServletResponse;


/** Fast and Dangeroud service strategy.
 *
 * <p>
 * Will fail when a ServiceException is encountered on writeTo, and will not
 * tell the user about it!
 * </p>
 *
 * <p>
 * This is the worst case scenario, you are trading speed for danger by using
 * this ServiceStrategy.
 * </p>
 *
 * @author jgarnett
 */
public class SpeedStrategy implements ServiceStrategy {
    public String getId() {
        return "SPEED";
    }

    /** DOCUMENT ME!  */
    private OutputStream out = null;

    /**
     * Works against the real output stream provided by the response.
     *
     * <p>
     * This is dangerous of course, but fast and exciting.
     * </p>
     *
     * @param response Response provided by doService
     *
     * @return An OutputStream that works against, the response output stream.
     *
     * @throws IOException If response output stream could not be aquired
     */
    public OutputStream getDestination(HttpServletResponse response)
        throws IOException {
        out = response.getOutputStream();
        out = new BufferedOutputStream(out);

        return out;
    }

    /**
     * Completes writing to Response.getOutputStream.
     *
     * @throws IOException If Response.getOutputStream not available.
     */
    public void flush(HttpServletResponse response) throws IOException {
        if (out != null) {
            out.flush();
        }
    }

    /* (non-Javadoc)
     * @see org.vfny.geoserver.servlets.AbstractService.ServiceStrategy#abort()
     */
    public void abort() {
        // out.close();
    }

    public Object clone() throws CloneNotSupportedException {
        return new SpeedStrategy();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -