int bytesAvailable;
FileInputStream fileInputStream = new FileInputStream(new File("somewhere"));
bytesAvailable = fileInputStream.available();
int maxBufferSize = 100;
int bufferSize = Math.min(bytesAvailable, maxBufferSize);
byte[] buffer = new byte[bufferSize];
// read file and write it into form...
int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
HttpURLConnection
을 공부하다가 이런 부분이 있는데, 검색을 해봐도 확실한 답이 나오지 않아 질문합니다!
여기서 byteAvailable
이 뜻하는 것과 FileInputStream
에서의 buffer
의 역할이 궁금합니다!!