(n, state)
| 24427 | // This function is designed to be inlinable, so please take care when making |
| 24428 | // changes to the function body. |
| 24429 | function howMuchToRead(n, state) { |
| 24430 | if (n <= 0 || state.length === 0 && state.ended) return 0; |
| 24431 | if (state.objectMode) return 1; |
| 24432 | if (n !== n) { |
| 24433 | // Only flow one buffer at a time |
| 24434 | if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; |
| 24435 | } |
| 24436 | // If we're asking for more than the current hwm, then raise the hwm. |
| 24437 | if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); |
| 24438 | if (n <= state.length) return n; |
| 24439 | // Don't have enough |
| 24440 | if (!state.ended) { |
| 24441 | state.needReadable = true; |
| 24442 | return 0; |
| 24443 | } |
| 24444 | return state.length; |
| 24445 | } |
| 24446 | |
| 24447 | // you can override either this method, or the async _read(n) below. |
| 24448 | Readable.prototype.read = function (n) { |
no test coverage detected