customserializer.java

来自「这个是perst-269.zip下面的SOURCECODE,和大家分享了。」· Java 代码 · 共 28 行

JAVA
28
字号
package org.garret.perst;

import java.io.*;

/**
 * Interface of custome serializer
 */
public interface CustomSerializer { 
    /**
     * Serialize object
     * @param obj object to be packed
     * @param out output stream to which object should be serialized
     */
    void pack(CustomSerializable obj, OutputStream out) throws IOException;

    /**
     * Deserialize object
     * @param in input stream from which object should be deserialized
     * @return unpacked object
     */
    CustomSerializable unpack(InputStream in) throws IOException;

    /**
     * Create object from its string representation
     * @param str string representation of object (created by toString() method)
     */
    CustomSerializable parse(String str) throws IOException;
}

⌨️ 快捷键说明

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