Prepends a byte array with it's length and creates a wrapped channel buffer @param payload The payload to wrap @return A channel buffer for testing
(final byte[] payload)
| 142 | * @return A channel buffer for testing |
| 143 | */ |
| 144 | protected ChannelBuffer getBuffer(final byte[] payload) { |
| 145 | final byte[] buf = new byte[payload.length + 4]; |
| 146 | System.arraycopy(payload, 0, buf, 4, payload.length); |
| 147 | Bytes.setInt(buf, payload.length); |
| 148 | return ChannelBuffers.wrappedBuffer(buf); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Helper to unwrap a wrapped buffer, pretending the sasl client simply |
no test coverage detected