()
| 372 | } |
| 373 | |
| 374 | private boolean doTestIo() throws Exception { |
| 375 | int bytes = readLittleEndianIntFromStdin(); |
| 376 | |
| 377 | if (bytes == -1) { |
| 378 | return false; // EOF |
| 379 | } |
| 380 | |
| 381 | byte[] serializedInput = new byte[bytes]; |
| 382 | |
| 383 | if (!readFromStdin(serializedInput, bytes)) { |
| 384 | throw new RuntimeException("Unexpected EOF from test program."); |
| 385 | } |
| 386 | |
| 387 | Conformance.ConformanceRequest request = |
| 388 | Conformance.ConformanceRequest.parseFrom(serializedInput); |
| 389 | Conformance.ConformanceResponse response = doTest(request); |
| 390 | byte[] serializedOutput = response.toByteArray(); |
| 391 | |
| 392 | writeLittleEndianIntToStdout(serializedOutput.length); |
| 393 | writeToStdout(serializedOutput); |
| 394 | |
| 395 | return true; |
| 396 | } |
| 397 | |
| 398 | public void run() throws Exception { |
| 399 | typeRegistry = |
no test coverage detected