亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? serialutilities.java

?? 水晶 ? ?  報表 ? ? ? 源碼
?? JAVA
字號:
/* ===================================================
 * JCommon : a free general purpose Java class library
 * ===================================================
 *
 * Project Info:  http://www.jfree.org/jcommon/index.html
 * Project Lead:  David Gilbert (david.gilbert@object-refinery.com);
 *
 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors.
 *
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation;
 * either version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this
 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * --------------------
 * SerialUtilities.java
 * --------------------
 * (C) Copyright 2000-2003, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: SerialUtilities.java,v 1.3 2003/06/13 15:46:55 mungady Exp $
 *
 * Changes
 * -------
 * 25-Mar-2003 : Version 1 (DG);
 *
 */

package org.jfree.io;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 * A class containing useful utility methods relating to serialization.
 *
 * @author David Gilbert
 */
public class SerialUtilities {

    /**
     * To prevent unnecessary instantiation.
     */
    protected SerialUtilities() {
        throw new UnsupportedOperationException();
    }

    /**
     * Reads a <code>Paint</code> object that has been serialised by the
     * {@link SerialUtilities#writePaint} method.
     *
     * @param stream  the input stream.
     *
     * @return The paint object.
     *
     * @throws IOException  if there is an I/O problem.
     * @throws ClassNotFoundException  if there is a problem loading a class.
     */
    public static Paint readPaint(ObjectInputStream stream)
        throws IOException, ClassNotFoundException {

        Paint result = null;
        boolean isNull = stream.readBoolean();
        if (!isNull) {
            Class c = (Class) stream.readObject();
            if (c.equals(Color.class)) {
                result = (Paint) stream.readObject();
            }
            else {
                result = (Paint) stream.readObject();
            }
        }
        return result;

    }

    /**
     * Serialises a <code>Paint</code> object.
     *
     * @param paint  the paint object.
     * @param stream  the output stream.
     *
     * @throws IOException if there is an I/O error.
     */
    public static void writePaint(Paint paint, ObjectOutputStream stream) throws IOException {

        if (paint != null) {
            stream.writeBoolean(false);
            if (paint instanceof Color) {
                stream.writeObject(Color.class);
                stream.writeObject(paint);
            }
            else {
                stream.writeObject(paint.getClass());
                stream.writeObject(paint);
            }
        }
        else {
            stream.writeBoolean(true);
        }

    }

    /**
     * Reads a <code>Stroke</code> object that has been serialised by the
     * {@link SerialUtilities#writeStroke} method.
     *
     * @param stream  the input stream.
     *
     * @return The stroke object.
     *
     * @throws IOException  if there is an I/O problem.
     * @throws ClassNotFoundException  if there is a problem loading a class.
     */
    public static Stroke readStroke(ObjectInputStream stream)
        throws IOException, ClassNotFoundException {

        Stroke result = null;
        boolean isNull = stream.readBoolean();
        if (!isNull) {
            Class c = (Class) stream.readObject();
            if (c.equals(BasicStroke.class)) {
                float width = stream.readFloat();
                int cap = stream.readInt();
                int join = stream.readInt();
                float miterLimit = stream.readFloat();
                float[] dash = (float[]) stream.readObject();
                float dashPhase = stream.readFloat();
                result = new BasicStroke(width, cap, join, miterLimit, dash, dashPhase);
            }
            else {
                result = (Stroke) stream.readObject();
            }
        }
        return result;

    }

    /**
     * Serialises a <code>Stroke</code> object.
     *
     * @param stroke  the stroke object.
     * @param stream  the output stream.
     *
     * @throws IOException if there is an I/O error.
     */
    public static void writeStroke(Stroke stroke, ObjectOutputStream stream) throws IOException {

        if (stroke != null) {
            stream.writeBoolean(false);
            if (stroke instanceof BasicStroke) {
                BasicStroke s = (BasicStroke) stroke;
                stream.writeObject(BasicStroke.class);
                stream.writeFloat(s.getLineWidth());
                stream.writeInt(s.getEndCap());
                stream.writeInt(s.getLineJoin());
                stream.writeFloat(s.getMiterLimit());
                stream.writeObject(s.getDashArray());
                stream.writeFloat(s.getDashPhase());
            }
            else {
                stream.writeObject(stroke.getClass());
                stream.writeObject(stroke);
            }
        }
        else {
            stream.writeBoolean(true);
        }
    }

    /**
     * Reads a <code>Shape</code> object that has been serialised by the {@link #writeShape} method.
     *
     * @param stream  the input stream.
     *
     * @return The shape object.
     *
     * @throws IOException  if there is an I/O problem.
     * @throws ClassNotFoundException  if there is a problem loading a class.
     */
    public static Shape readShape(ObjectInputStream stream)
        throws IOException, ClassNotFoundException {

        Shape result = null;
        boolean isNull = stream.readBoolean();
        if (!isNull) {
            Class c = (Class) stream.readObject();
            if (c.equals(Line2D.class)) {
                double x1 = stream.readDouble();
                double y1 = stream.readDouble();
                double x2 = stream.readDouble();
                double y2 = stream.readDouble();
                result = new Line2D.Double(x1, y1, x2, y2);
            }
            else if (c.equals(Rectangle2D.class)) {
                double x = stream.readDouble();
                double y = stream.readDouble();
                double w = stream.readDouble();
                double h = stream.readDouble();
                result = new Rectangle2D.Double(x, y, w, h);
            }
            else if (c.equals(Ellipse2D.class)) {
                double x = stream.readDouble();
                double y = stream.readDouble();
                double w = stream.readDouble();
                double h = stream.readDouble();
                result = new Ellipse2D.Double(x, y, w, h);
            }
            else {
                result = (Shape) stream.readObject();
            }
        }
        return result;

    }

    /**
     * Serialises a <code>Shape</code> object.
     *
     * @param shape  the shape object.
     * @param stream  the output stream.
     *
     * @throws IOException if there is an I/O error.
     */
    public static void writeShape(Shape shape, ObjectOutputStream stream) throws IOException {

        if (shape != null) {
            stream.writeBoolean(false);
            if (shape instanceof Line2D) {
                Line2D line = (Line2D) shape;
                stream.writeObject(Line2D.class);
                stream.writeDouble(line.getX1());
                stream.writeDouble(line.getY1());
                stream.writeDouble(line.getX2());
                stream.writeDouble(line.getY2());
            }
            else if (shape instanceof Rectangle2D) {
                Rectangle2D rectangle = (Rectangle2D) shape;
                stream.writeObject(Rectangle2D.class);
                stream.writeDouble(rectangle.getX());
                stream.writeDouble(rectangle.getY());
                stream.writeDouble(rectangle.getWidth());
                stream.writeDouble(rectangle.getHeight());
            }
            else if (shape instanceof Ellipse2D) {
                Ellipse2D ellipse = (Ellipse2D) shape;
                stream.writeObject(Ellipse2D.class);
                stream.writeDouble(ellipse.getX());
                stream.writeDouble(ellipse.getY());
                stream.writeDouble(ellipse.getWidth());
                stream.writeDouble(ellipse.getHeight());
            }
            else {
                stream.writeObject(shape.getClass());
                stream.writeObject(shape);
            }
        }
        else {
            stream.writeBoolean(true);
        }
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级夜夜爽| 94-欧美-setu| 99国内精品久久| 亚洲免费视频成人| 欧美精品 国产精品| 亚洲一区二区三区四区不卡| 91成人免费电影| 精品国产露脸精彩对白| 国产.欧美.日韩| 日日骚欧美日韩| 成人18视频在线播放| 欧美日韩免费一区二区三区 | 欧美一级高清片| 日韩理论片中文av| 国产精品资源在线看| 91麻豆精品国产自产在线观看一区| 中文字幕在线视频一区| 国产在线精品一区在线观看麻豆| 欧美视频一区二区在线观看| 国产精品电影一区二区| 亚洲夂夂婷婷色拍ww47| 7777精品伊人久久久大香线蕉| 欧美国产精品专区| 国产精品一区二区视频| 欧美精品一区二区三区四区 | 日韩精品中文字幕一区二区三区 | 久久久青草青青国产亚洲免观| 亚瑟在线精品视频| 在线一区二区三区四区五区| 国产精品美女久久久久久2018| 国产美女精品人人做人人爽| 欧美哺乳videos| 精品无码三级在线观看视频| 日韩午夜激情免费电影| 蜜臀a∨国产成人精品| 欧美精选一区二区| 午夜电影一区二区三区| 欧美美女激情18p| 奇米精品一区二区三区在线观看一| 色激情天天射综合网| 亚洲伦在线观看| 在线观看欧美日本| 亚洲va欧美va天堂v国产综合| 欧美丝袜自拍制服另类| 日日嗨av一区二区三区四区| 欧美一级艳片视频免费观看| 久久不见久久见免费视频7| 久久免费偷拍视频| 成人精品免费视频| 亚洲国产婷婷综合在线精品| 91精品欧美综合在线观看最新| 日韩精品一二三区| 26uuu亚洲| 成人av免费在线观看| 怡红院av一区二区三区| 欧美精三区欧美精三区| 国产一区高清在线| 亚洲欧美中日韩| 欧美理论在线播放| 国产乱淫av一区二区三区| 中文字幕第一区综合| 欧美亚洲动漫精品| 久久99久久99| 综合电影一区二区三区| 欧美电影一区二区三区| 国产精品羞羞答答xxdd| 一区二区三区四区在线免费观看| 欧美精品一二三| 国产成人在线观看| 成人免费视频视频| 亚洲电影视频在线| 久久精品夜色噜噜亚洲a∨| 成人免费高清视频| 免费国产亚洲视频| 国产精品久久福利| 欧美一级xxx| 色婷婷综合久久久久中文一区二区 | 一区二区视频在线| 亚洲精品一区二区三区影院| 色综合色狠狠综合色| 毛片一区二区三区| 亚洲少妇最新在线视频| 久久综合九色综合97_久久久| 一本色道a无线码一区v| 黄色小说综合网站| 亚洲福利一二三区| 亚洲欧洲国产日韩| 精品国产三级电影在线观看| 欧美日韩一区二区在线视频| 丁香婷婷深情五月亚洲| 日韩电影免费一区| 亚洲自拍与偷拍| 国产精品天天看| www国产精品av| 欧美一区二区三区成人| 91原创在线视频| 国产成人免费9x9x人网站视频| 奇米精品一区二区三区在线观看| 伊人开心综合网| 日韩一区中文字幕| 亚洲国产精品二十页| 欧美成人bangbros| 亚洲人成精品久久久久| 337p粉嫩大胆色噜噜噜噜亚洲 | 欧美成人伊人久久综合网| 在线观看网站黄不卡| 99久久精品免费精品国产| 国产精品一区二区在线观看不卡| 久久99精品久久久久久久久久久久 | 久久新电视剧免费观看| 欧美一区二区视频在线观看2020| 99在线精品观看| 福利一区在线观看| 国产成人免费av在线| 国产成人自拍在线| 国产一区二区三区美女| 久久99久国产精品黄毛片色诱| 老司机免费视频一区二区三区| 午夜影院久久久| 日韩av一区二区三区| 五月婷婷久久丁香| 蜜桃视频一区二区三区在线观看| 日韩高清在线电影| 精品一区二区三区视频在线观看 | 亚洲国产成人午夜在线一区| 久久久久久久久岛国免费| 久久嫩草精品久久久久| 国产欧美精品一区| 中文字幕一区二区三区乱码在线| 中文久久乱码一区二区| 亚洲欧美一区二区视频| 亚洲综合一二区| 亚洲成在人线在线播放| 免费高清在线视频一区·| 久久草av在线| caoporen国产精品视频| 日本精品裸体写真集在线观看| 欧美性猛交xxxx乱大交退制版| 欧美日韩大陆一区二区| 精品乱人伦小说| 国产精品欧美久久久久无广告 | 91天堂素人约啪| 欧美视频一区二| 精品久久久久久久一区二区蜜臀| 久久麻豆一区二区| 亚洲精品视频免费看| 亚洲在线观看免费| 久久精品国产网站| 99在线精品一区二区三区| 欧美日本免费一区二区三区| 久久先锋影音av| 亚洲美女偷拍久久| 国产综合色视频| 99国产精品国产精品毛片| 欧美精品在欧美一区二区少妇| 久久亚洲精精品中文字幕早川悠里 | 91成人网在线| 91精品国产综合久久精品性色| 欧美不卡一区二区| 一区二区三区不卡视频| 国产原创一区二区三区| 91在线播放网址| 久久人人97超碰com| 亚洲人成精品久久久久久| 精品一区二区三区免费| 色视频一区二区| 亚洲国产精品国自产拍av| 亚洲a一区二区| 国产.欧美.日韩| 欧美不卡123| 香港成人在线视频| 99v久久综合狠狠综合久久| 精品毛片乱码1区2区3区| 亚洲一区二区三区四区在线 | 欧美日韩日日摸| 国产精品无圣光一区二区| 美女网站视频久久| 在线观看亚洲a| 亚洲欧美自拍偷拍| 国产激情视频一区二区三区欧美| 6080日韩午夜伦伦午夜伦| 色狠狠av一区二区三区| 色婷婷久久久久swag精品| 欧美一级精品大片| 五月婷婷久久丁香| 91麻豆国产福利精品| 国产色产综合色产在线视频| 久久精品99国产精品| 欧美日韩综合不卡| 一区二区在线电影| 色哟哟精品一区| 国产精品灌醉下药二区| 国产成人超碰人人澡人人澡| 精品久久国产字幕高潮| 欧美aⅴ一区二区三区视频| 欧美日韩一区视频| 丝袜美腿亚洲一区| 91精品国产入口| 免费人成精品欧美精品| 制服丝袜一区二区三区|