(boolean doRead)
| 1042 | |
| 1043 | |
| 1044 | @Override |
| 1045 | protected final int available(boolean doRead) { |
| 1046 | if (endOfStream) { |
| 1047 | return 0; |
| 1048 | } |
| 1049 | if (empty && doRead) { |
| 1050 | try { |
| 1051 | refillReadBuffer(false); |
| 1052 | } catch (IOException ioe) { |
| 1053 | /* |
| 1054 | * Probably a timeout. This approach isn't ideal but it works. Returning 1 will indicate that data is |
| 1055 | * available which should trigger a read which in turn will trigger another IOException and that one can |
| 1056 | * be thrown. |
| 1057 | */ |
| 1058 | return 1; |
| 1059 | } |
| 1060 | } |
| 1061 | if (empty) { |
| 1062 | return 0; |
| 1063 | } else { |
| 1064 | return request.getInputBuffer().available(); |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | |
| 1069 | @Override |
no test coverage detected