import java.io.InputStream;
import android.content.res.Resources;
class Main {
/**
* Return a specific raw resource contents as a String value.
*/
public static String getRawString(Resources res, int id) throws Exception {
String result = null;
InputStream is = null;
try {
is = res.openRawResource(id);
byte[] raw = new byte[is.available()];
is.read(raw);
result = new String(raw);
} catch (Exception e) {
throw new Exception("Problem while trying to read raw", e);
} finally {
try {
is.close();
} catch (Exception e) {
}
}
return result;
}
}