class GraphPersistenceProvider implements WorkspaceBytesPersistenceProvider {

    private static final int GRAPHSTORE_SERIALIZATION_GRAPHMODEL_CONFIG_ID = 205;

    @Override
    public void writeBytes(DataOutputStream stream, Workspace workspace) {
        GraphModel model = workspace.getLookup().lookup(GraphModel.class);
        if (model != null) {
            try {
                GraphModel.Serialization.write(stream, model);
            } catch (IOException ex) {
                Logger.getLogger("").log(Level.SEVERE, "", ex.getCause());
            }
        }
    }

    @Override
    public void readBytes(DataInputStream stream, Workspace workspace) {<FILL_FUNCTION_BODY>}

    @Override
    public String getIdentifier() {
        return "graphstore";
    }
}

        GraphModel model = workspace.getLookup().lookup(GraphModel.class);
        try {
            //Detect if the serialized graphstore declares its own version:
            stream.mark(1);
            int firstFieldType = stream.readUnsignedByte();
            stream.reset();

            if (firstFieldType == GRAPHSTORE_SERIALIZATION_GRAPHMODEL_CONFIG_ID) {
                //Old graphstore, from Gephi 0.9.0
                model = GraphModel.Serialization.readWithoutVersionHeader(stream,
                    0.0f /* no version, first was 0.4*/);//Previous to version header existing at all

                //TODO: Also properly handle the case when model isn't null
            } else {
                if (model != null) {
                    model = GraphModel.Serialization.read(stream, model);
                } else {
                    model = GraphModel.Serialization.read(stream);
                }
            }

            workspace.add(model);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    
<no_super_class>