Skip to content

Commit e0f4c96

Browse files
committed
build fixes
1 parent 819484d commit e0f4c96

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/matlabcontrol/MatlabProxyFactoryOptions.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ boolean getUseSingleComputationalThread() {
100100
int getPort() {
101101
return _port;
102102
}
103-
104-
public Writer getInputWriter() {
103+
104+
Writer getInputWriter() {
105105
return _inputWriter;
106106
}
107107

108-
public Writer getErrorWriter() {
108+
Writer getErrorWriter() {
109109
return _errorWriter;
110110
}
111111

@@ -401,28 +401,28 @@ public final Builder setPort(int port) {
401401

402402
return this;
403403
}
404-
404+
405405
/**
406406
* Sets the input writer where the standard output of the created matlab process is written to.
407407
* This is only used when an actual process is spawned for the matlab proxy instance.
408408
*
409409
* @param inputWriter
410410
*/
411-
public final Builder setInputWriter(Writer inputWriter){
411+
public final Builder setInputWriter(Writer inputWriter) {
412412
_inputWriter = inputWriter;
413-
413+
414414
return this;
415415
}
416-
416+
417417
/**
418418
* Sets the error writer where the error output of the created matlab process is written to.
419419
* This is only used when an actual process is spawned for the matlab proxy instance.
420420
*
421421
* @param inputWriter
422422
*/
423-
public final Builder setErrorWriter(Writer errorWriter){
423+
public final Builder setErrorWriter(Writer errorWriter) {
424424
_errorWriter = errorWriter;
425-
425+
426426
return this;
427427
}
428428

src/matlabcontrol/RemoteMatlabProxyFactory.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.io.InputStreamReader;
1111
import java.io.Reader;
1212
import java.io.Writer;
13+
import java.nio.charset.Charset;
1314
import java.rmi.AlreadyBoundException;
1415
import java.rmi.NoSuchObjectException;
1516
import java.rmi.NotBoundException;
@@ -316,7 +317,7 @@ private static class ProcessStreamDrainer extends Thread {
316317
private final Writer _writer;
317318

318319
private ProcessStreamDrainer(InputStream stream, String type, Writer writer) {
319-
_reader = new InputStreamReader(stream);
320+
_reader = new InputStreamReader(stream, Charset.defaultCharset());
320321
_writer = writer;
321322

322323
this.setDaemon(true);
@@ -327,11 +328,11 @@ private ProcessStreamDrainer(InputStream stream, String type, Writer writer) {
327328
public void run() {
328329
try {
329330
char[] buffer = new char[1024];
330-
if(_writer != null){
331-
while (_reader.read(buffer) != -1){
331+
if (_writer != null) {
332+
while (_reader.read(buffer) != -1) {
332333
_writer.write(buffer);
333334
}
334-
}else{
335+
} else {
335336
while (_reader.read(buffer) != -1)
336337
;
337338
}
@@ -340,7 +341,7 @@ public void run() {
340341
throw new RuntimeException(e);
341342
}
342343
}
343-
344+
344345
}
345346

346347
/**

0 commit comments

Comments
 (0)