public Map<Object, Object> toOptionsMap() { Map<Object, Object> result = Maps.newHashMapWithExpectedSize(2); addTo(result); return result; }
protected String saveResource(Resource resource) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(content.length()); try { Map<Object, Object> options = Maps.newHashMap(); options.put(XtextResource.OPTION_ENCODING, INTERNAL_ENCODING); SaveOptions.defaultOptions().addTo(options); resource.save(out, options); String result = new String(out.toByteArray(), INTERNAL_ENCODING); return result; } finally { out.close(); } }