string 썸네일형 리스트형 String & StringBuilder & StringBuffer String : immutable StringBuffer & StringBuilder : mutable Immutable mutable 불변의 변하기 쉬운 더보기 change String to Document [ change java.lang.String to org.w3c.dom.Document ] String을 Document로 바꾸어 줍니다. import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; String xmlString = "..."; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.n.. 더보기 inputStream to String inputStream을 String으로 출력한다. public String isToString(InputStream is) throws IOException { if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader( new InputStreamReader(is, "UTF-8")); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } } finally { is.close(); } return writer.toString(); } else { ret.. 더보기 이전 1 다음