본문 바로가기

전체 글33

[JAVA] 입출력(I/O) Stream - 3 (보조스트림) 용량이 큰 파일을 입출력 할 때는 버퍼를 사용하는 것이 효율적이다. 🌳 바이트 기반의 버퍼 스트림 사용하기 public class BufferedIOTest01 { public static void main(String[] args) { try { FileOutputStream ouptut = new FileOutputStream("d:/d_other/bufferTest.txt"); // 버퍼의 크기가 5인 (보조)버퍼스트림 객체 생성 // => 버퍼의 크기를 지정하지 않으면 기본 크기인 8Kb(8196byte)로 지정된다. BufferedOutputStream bufOutput = new BufferedOutputStream(ouptut, 5); System.out.println("작업 시작"); fo.. 2021. 8. 6.
[JavaScript] 함수의 선언과 표현 함수의 선언식과 표현식의 차이점 / Arrow function에 대해서 알아보기 // Function // - fundamental building block in the program // - subprogram can be used multiple times // - performs a task or calculates a value // 1. Function declaration // function name(param1, param2) { body...return; } // ⭐ one function === one thing (하나의 함수는 한 가지의 일만 하도록 생성해야 함) // naming: doSomething, command, verb // e.g. createCardAndPoint ->.. 2021. 8. 5.
[JAVA] 입출력(I/O) Stream - 2 1. 입출력(I/O)이란? - 입력(Input)과 출력(Output)을 줄여 부르는 말 - 두 대상 간의 데이터를 주고 받는 것 2. 스트림(stream)이란? - 데이터를 운반(입출력)하는데 사용되는 연결 통로 - 하나의 스트림으로 입출력을동시에 수행할 수 없다. (단방향 통신) - 입출력을 동시에 수행하려면 2개의 스트림이 필요하다. - 바이트 기반 스트림(기본) : 데이터를 바이트 단위로 주고 받는다. - 보조 스트림 : 스트림의 기능을 향상시키거나 새로운 기능을 추가하기 위해 사용한다. 독립적으로 입출력을 수행할 수 없다. - 문자 기반 스트림 : 입출력 단위가 문자(char, 2 byte)인 스트림 문자기반 스트림의 최고 조상이다. 🌳 바이트 기반 스트림 실습 1 (1byte 씩 가져오기) pu.. 2021. 8. 5.
[JavaScript] 연산/반복문 // 1. String concatenation console.log('my' + ' cat'); console.log('1' + 2); console.log(`string literals: 1 + 2 = ${1 + 2}`); // 2. Numeric operators console.log(1 + 1); // add console.log(1 - 1); // subtract console.log(1 / 1); // divide console.log(1 * 1); // multiply console.log(5 % 2); // remainder console.log(2 ** 3); // exponentiation // 3. Increment and decrement operators let counter = .. 2021. 8. 5.