Skip to content

Commit 73a3972

Browse files
committed
Fix whitespace
1 parent fb4d1ea commit 73a3972

File tree

6 files changed

+65
-65
lines changed

6 files changed

+65
-65
lines changed

packages/core/java/src/main/java/org/itk/wasm/BinaryStream.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
package org.itk.wasm;
2121

2222
public class BinaryStream {
23-
public byte[] data;
23+
public byte[] data;
2424

25-
public BinaryStream(byte[] data) {
26-
this.data = data;
27-
}
25+
public BinaryStream(byte[] data) {
26+
this.data = data;
27+
}
2828
}

packages/core/java/src/main/java/org/itk/wasm/InterfaceTypes.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
*/
2020
package org.itk.wasm;
2121
public enum InterfaceTypes {
22-
TextFile("InterfaceTextFile"),
23-
BinaryFile("InterfaceBinaryFile"),
24-
TextStream("InterfaceTextStream"),
25-
BinaryStream("InterfaceBinaryStream"),
26-
Image("InterfaceImage"),
27-
Mesh("InterfaceMesh"),
28-
PolyData("InterfacePolyData"),
29-
JsonObject("InterfaceJsonObject");
22+
TextFile("InterfaceTextFile"),
23+
BinaryFile("InterfaceBinaryFile"),
24+
TextStream("InterfaceTextStream"),
25+
BinaryStream("InterfaceBinaryStream"),
26+
Image("InterfaceImage"),
27+
Mesh("InterfaceMesh"),
28+
PolyData("InterfacePolyData"),
29+
JsonObject("InterfaceJsonObject");
3030

31-
private String value;
31+
private String value;
3232

33-
private InterfaceTypes(String value) {
34-
this.value = value;
35-
}
33+
private InterfaceTypes(String value) {
34+
this.value = value;
35+
}
3636

37-
public String getValue() {
38-
return value;
39-
}
37+
public String getValue() {
38+
return value;
39+
}
4040
}

packages/core/java/src/main/java/org/itk/wasm/Pipeline.java

+32-32
Original file line numberDiff line numberDiff line change
@@ -88,34 +88,34 @@ public Pipeline(byte[] wasmBytes) {
8888
}
8989

9090
public List<PipelineOutput<?>> run(List<String> args, List<PipelineOutput<?>> outputs, List<PipelineInput<?>> inputs) {
91-
try (RunInstance ri = new RunInstance(args, outputs, inputs)) {
92-
int returnCode = ri.delayedStart();
93-
94-
List<PipelineOutput<?>> populatedOutputs = new ArrayList<>();
95-
if (!outputs.isEmpty() && returnCode == 0) {
96-
for (int index = 0; index < outputs.size(); index++) {
97-
PipelineOutput<?> output = outputs.get(index);
98-
if (output.type == InterfaceTypes.TextStream) {
99-
int dataPtr = ri.outputArrayAddress(0, index, 0);
100-
int dataLen = ri.outputArraySize(0, index, 0);
101-
byte[] dataBytes = ri.wasmTimeLift(dataPtr, dataLen);
102-
String dataString = str(dataBytes);
103-
TextStream textStream = new TextStream(dataString);
104-
populatedOutputs.add(new PipelineOutput<>(InterfaceTypes.TextStream, textStream));
105-
} else if (output.type == InterfaceTypes.BinaryStream) {
106-
int dataPtr = ri.outputArrayAddress(0, index, 0);
107-
int dataLen = ri.outputArraySize(0, index, 0);
108-
byte[] dataBytes = ri.wasmTimeLift(dataPtr, dataLen);
109-
BinaryStream binaryStream = new BinaryStream(dataBytes);
110-
populatedOutputs.add(new PipelineOutput<>(InterfaceTypes.BinaryStream, binaryStream));
111-
} else {
112-
throw new IllegalArgumentException("Unexpected/not yet supported output.type " + output.type);
113-
}
114-
}
115-
}
116-
117-
return populatedOutputs;
118-
}
91+
try (RunInstance ri = new RunInstance(args, outputs, inputs)) {
92+
int returnCode = ri.delayedStart();
93+
94+
List<PipelineOutput<?>> populatedOutputs = new ArrayList<>();
95+
if (!outputs.isEmpty() && returnCode == 0) {
96+
for (int index = 0; index < outputs.size(); index++) {
97+
PipelineOutput<?> output = outputs.get(index);
98+
if (output.type == InterfaceTypes.TextStream) {
99+
int dataPtr = ri.outputArrayAddress(0, index, 0);
100+
int dataLen = ri.outputArraySize(0, index, 0);
101+
byte[] dataBytes = ri.wasmTimeLift(dataPtr, dataLen);
102+
String dataString = str(dataBytes);
103+
TextStream textStream = new TextStream(dataString);
104+
populatedOutputs.add(new PipelineOutput<>(InterfaceTypes.TextStream, textStream));
105+
} else if (output.type == InterfaceTypes.BinaryStream) {
106+
int dataPtr = ri.outputArrayAddress(0, index, 0);
107+
int dataLen = ri.outputArraySize(0, index, 0);
108+
byte[] dataBytes = ri.wasmTimeLift(dataPtr, dataLen);
109+
BinaryStream binaryStream = new BinaryStream(dataBytes);
110+
populatedOutputs.add(new PipelineOutput<>(InterfaceTypes.BinaryStream, binaryStream));
111+
} else {
112+
throw new IllegalArgumentException("Unexpected/not yet supported output.type " + output.type);
113+
}
114+
}
115+
}
116+
117+
return populatedOutputs;
118+
}
119119
}
120120

121121
private static String purePosixPath(Path p) {
@@ -252,10 +252,10 @@ public RunInstance(List<String> args, List<PipelineOutput<?>> outputs,
252252
public void freeAll() { freeAll.accept(); }
253253

254254
public ByteBuffer memoryBuffer(int offset, int length) {
255-
ByteBuffer buffer = memory.buffer(store);
256-
buffer.position(offset);
257-
buffer.limit(length);
258-
return buffer.slice();
255+
ByteBuffer buffer = memory.buffer(store);
256+
buffer.position(offset);
257+
buffer.limit(length);
258+
return buffer.slice();
259259
}
260260
public int memorySize() { return memory.size(store); }
261261

packages/core/java/src/main/java/org/itk/wasm/PipelineInput.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package org.itk.wasm;
2121

2222
public class PipelineInput<T> {
23-
public InterfaceTypes type;
24-
public T data;
25-
public String path;
23+
public InterfaceTypes type;
24+
public T data;
25+
public String path;
2626
}

packages/core/java/src/main/java/org/itk/wasm/PipelineOutput.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
package org.itk.wasm;
2121

2222
public class PipelineOutput<T> {
23-
public InterfaceTypes type;
24-
public T data;
25-
public String path;
23+
public InterfaceTypes type;
24+
public T data;
25+
public String path;
2626

27-
public PipelineOutput(InterfaceTypes type, T data) {
28-
this.type = type;
29-
this.data = data;
30-
}
27+
public PipelineOutput(InterfaceTypes type, T data) {
28+
this.type = type;
29+
this.data = data;
30+
}
3131
}

packages/core/java/src/main/java/org/itk/wasm/TextStream.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
package org.itk.wasm;
2121

2222
public class TextStream {
23-
public String data;
23+
public String data;
2424

25-
public TextStream(String data) {
26-
this.data = data;
27-
}
25+
public TextStream(String data) {
26+
this.data = data;
27+
}
2828
}

0 commit comments

Comments
 (0)