public static String readString(IStreamContentAccessor sa) throws CoreException { InputStream is= sa.getContents(); if (is != null) { String encoding= null; if (sa instanceof IEncodedStreamContentAccessor) {
private static String readString(InputStream is, String encoding) { if (is == null) return null; BufferedReader reader= null; try { StringBuffer buffer= new StringBuffer(); char[] part= new char[2048]; int read= 0; reader= new BufferedReader(new InputStreamReader(is, encoding));  while ((read= reader.read(part)) != -1) buffer.append(part, 0, read);  return buffer.toString();  } catch (IOException ex) {  } finally { if (reader != null) {
	public static String readString(IStreamContentAccessor sa) throws CoreException {		InputStream is= sa.getContents();		if (is != null) {			String encoding= null;			if (sa instanceof IEncodedStreamContentAccessor) {				try {					encoding= ((IEncodedStreamContentAccessor) sa).getCharset();				} catch (Exception e) {				}			}			if (encoding == null)				encoding= ResourcesPlugin.getEncoding();			return readString(is, encoding);		}		return null;	}