본문 바로가기
728x90
반응형
SMALL

자바19

properties file 한글 깨짐 현상 해결 방법 NOTICE.TITLE=보안계정 신청 natice2ascii -encoding UTF-8 config.properties config_ko.properties NOTICE.TITLE=\ubcf4\uc548\uacc4\uc815 \uc2e0\uccad 2013. 12. 21.
java unsigned int byte로 타입 캐스팅을 해서 출력하면 이상한 값이 들어가는 것처럼 보이는 이유는 byte도 int의 경우처럼 맨 앞의 비트를 sign bit 으로 사용하기 때문이다. 8bit로 표현되는 0xff 이하의 수치(0~255)에 한해서 (byte)형으로 casting하게 되면 하여 집어넣을 경우 & 0xff 연산을 해 주게되면 32bit 크기(int)로 unsigned byte의 값을 얻을 수 있다. 2013. 12. 21.
Java http, https URL 접근 및 response xml data 읽기 HashMap rtnMap = new HashMap();URL url;HttpURLConnection connection = null;HttpsURLConnection conn = null;BufferedReader br = null;StringBuffer strXMLbuf = new StringBuffer();try{ String strUrl = SystemEnvironment.getInstance().getEnviroment().getOtpUrl(); InputStream in = null; if(strUrl.indexOf("https://") > -1) // https 통신(ssl) { url = new URL(SystemEnvironment.getInstance().getEnviroment().g.. 2013. 12. 21.
Java 객체 직렬화 public void sendObjTest() { DatagramSocket socket = null; ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; try { // 변수 초기화 baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); // 값 setting Properties prop = new Properties(); prop.put("certId", "yhkim"); prop.put("clientIp", "192.168.3.31"); // 객체 쓰기 oos.writeObject(prop); oos.flush(); byte[] Buf= baos.toByteAr.. 2013. 12. 21.
728x90
반응형
LIST