···409409 }
410410411411 bytesAvailable = input.available();
412412+413413+ // If no bytes are reported as being available, but we have
414414+ // not yet received a full line, then we need to attempt
415415+ // another single-byte blocking read.
416416+ if(bytesAvailable == 0) {
417417+ firstByte = input.read();
418418+ byteStream.write((byte)firstByte);
419419+ bytesReceived++;
420420+ bytesAvailable = input.available();
421421+ }
412422 }
413423 }
414424 else {