Code RoomFile read assumes default encoding
MediumPrep Room Coding #1765

File read assumes default encoding

Code reviewCode quality & reviewMid–Senior~25 min

Review this Java that reads an uploaded text file's contents.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 25 min
Mark a line and say what kind of problem it is.0 findings
1import java.io.*;
2 
3String readAll(InputStream in) throws IOException {
4 BufferedReader r = new BufferedReader(new InputStreamReader(in));
5 StringBuilder sb = new StringBuilder();
6 String line;
7 while ((line = r.readLine()) != null) sb.append(line).append('\n');
8 return sb.toString();
9}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.