(MessageBytes mb, boolean terminated)
| 297 | } |
| 298 | |
| 299 | private void doGetBytes(MessageBytes mb, boolean terminated) { |
| 300 | int length = getInt(); |
| 301 | if (length == 0xFFFF || length == -1) { |
| 302 | mb.recycle(); |
| 303 | return; |
| 304 | } |
| 305 | if (terminated) { |
| 306 | validatePos(pos + length + 1); |
| 307 | } else { |
| 308 | validatePos(pos + length); |
| 309 | } |
| 310 | mb.setBytes(buf, pos, length); |
| 311 | mb.getCharChunk().recycle(); // not valid anymore |
| 312 | pos += length; |
| 313 | if (terminated) { |
| 314 | pos++; // Skip the terminating \0 |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | |
| 319 | /** |
no test coverage detected