final Reader reader = new InputStreamReader(
new FileInputStream(file), StandardCharsets.UTF_8
);
try {
final char[] chars = new char[8];
<BUG>reader.read(chars);
socket = new ServerSocket(
Integer.parseInt(new String(chars))
</BUG>
);

final Reader reader = new InputStreamReader(
new FileInputStream(file), StandardCharsets.UTF_8
);
try {
final char[] chars = new char[8];
final int length = reader.read(chars);
socket = new ServerSocket(
Integer.parseInt(new String(chars, 0, length))
);
