IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
graph.setFileName(filePath);
// writes graph
ByteArrayOutputStream out = new ByteArrayOutputStream();
GenericGraphWriter writer = new GenericGraphWriter(graph);
try {
writer.write(file.getLocation().toString(), out);
return new ByteArrayInputStream(out.toByteArray());
} catch (RuntimeException e) {
errorMessage("Exception", e);
}