public class Main {
public static void main(String[] args) throws IOException {
SpiDevice spi = SpiFactory.getInstance(SpiChannel.CS0);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
String line;
while ((line = reader.readLine()) != null) {
String[] split = line.split(" ");
ByteBuffer buf = ByteBuffer.allocate(split.length);
Stream.of(split).map(Byte::parseByte).forEach(buf::put);
ByteBuffer result = spi.write(buf);
System.out.println(Arrays.toString(result.array()));
}
}
}
}