ByteArrayOutputStream () { if (this instanceof WinTerminalExecutor) { return super.getBinaryOutput(); } ByteArrayOutputStream result = new ByteArrayOutputStream(); byte[] outputBytes = getOutput().getBytes(StandardCharsets.UTF_8); result.write(outputBytes, 0, outputBytes.length); return result; }