반응형
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
...
public static void main(String[] args) throws IOException, UnsupportedEncodingException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
String str = "https://prettycode.tistory.com/";
baos.write(str.getBytes());
String result = new String(baos.toByteArray(), "UTF-8");
System.out.println(result);
}
반응형
'java' 카테고리의 다른 글
IfUtil (0) | 2020.05.22 |
---|---|
Direct self-reference leading to cycle exception (0) | 2020.05.15 |
STS 롬복 설치, lombok install (0) | 2020.02.15 |
java - double to int (0) | 2020.02.04 |
JSP EL 내장 객체 (0) | 2019.12.26 |
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.1.0 (0) | 2019.12.09 |
CustomPageable (0) | 2019.12.09 |
org.apache.http.ProtocolException: Target host is not specified (0) | 2019.12.09 |