java.io.InputStream.read(byte[] b, int off, int len)

https://www.tutorialspoint.com/java/io/inputstream_read_byte_len.htm

The java.io.InputStream.read(byte[] b, int off, int len) method reads upto len bytes of data from the input stream into an array of bytes. If the parameter len is zero, then no bytes are read and 0 is returned; else there is an attempt to read at least one byte. If the stream is at the end of the file, the value returned is -1.

Parameters

  • b − The destination byte array.
  • off − The start offset in array b at which the data is written.
  • len − The number of bytes to read.

Return Value

The method returns the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Exception

  • IOException − If an I/O error occurs.
  • NullPointerException − If b is null.
  • IndexOutOfBoundsException − If off is negative, len is negative, or len is greater than b.length – off.

 

Lab8

Lab8_1 ~ Lab8_6 코드 분석 보고서 (장수제한없음)를 넣고 Lab8_학번_이름.zip 압축한 후 e-learning (http://lms.dankook.ac.kr/index.jsp)으로 제출 (Due by 12/10)

java2-lab8

Lab8_1 TCP Client/Server
Lab8_2 UDP Client/Server
Lab8_3 HTTP (GET vs POST)
Lab8_4 ImageTransfer 1 image Client -> Server (using TCP)
Lab8_4 ImageDownloader 1 image Server -> Client (using TCP)
Lab8_4 ImageDownloaderWithFilename 1 image Server -> Client (using TCP)
Lab8_4 MultipleImageTransfer 20 images Client -> Server (using TCP)
Lab8_4 ThreadedMultipleImageTransfer 20 images Client -> Server (using TCP & # of threads)
Lab8_5 NetworkAnimatedImageViewFX (JavaFX, Thread, Network)
Lab8_6 Chat (JavaFX, Thread, TCP Reflector)