|
@@ -23,8 +23,14 @@ public class ByteArrayReaderWriter implements ReaderWriter<ByteArray> {
|
|
|
@Override
|
|
|
public ByteArray read() throws IOException {
|
|
|
int availableBytes;
|
|
|
- while ((availableBytes = in.available()) <= 0)
|
|
|
- ;
|
|
|
+ while((availableBytes = in.available()) <= 0) {
|
|
|
+ try {
|
|
|
+ Thread.sleep(500);
|
|
|
+ System.out.println("thread schläft");
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
byte[] buffer = new byte[availableBytes];
|
|
|
in.read(buffer);
|
|
|
return new ByteArray(buffer);
|