Package de.FeatureModellingTool.GraphicalEditor.store

Source Code of de.FeatureModellingTool.GraphicalEditor.store.AdaptedStandardStorageFormat

package de.FeatureModellingTool.GraphicalEditor.store;

import research.store.StandardStorageFormat;
import research.store.StorableOutput;
import research.store.StorableInput;
import research.Drawing;

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;

public class AdaptedStandardStorageFormat extends StandardStorageFormat {
  public void store(OutputStream stream, Drawing saveDrawing) throws IOException {
        StorableOutput output = new StorableOutput(stream);
        output.writeStorable(saveDrawing);
        output.close();
        return;
   }
    public void store(Writer writer ,Drawing saveDrawing) throws IOException{
      StorableOutput output = new StorableOutput(writer);
      output.writeStorable(saveDrawing);
      output.close(); // ���ܵ�������Χû�취�õ����������Ϣ
      return ;
    }

    public Drawing restore(InputStream stream) throws IOException {
        StorableInput input = new StorableInput(stream);
        return (Drawing) input.readStorable();
    }

}
TOP

Related Classes of de.FeatureModellingTool.GraphicalEditor.store.AdaptedStandardStorageFormat

TOP
Copyright © 2018 www.massapi.com. 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.