MCPcopy Index your code
hub / github.com/OpenTSDB/asynchbase / getBuffer

Method getBuffer

test/BaseTestSecureRpcHelper.java:144–149  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

unwrapNotWrappedMethod · 0.80
unwrapExceptionMethod · 0.80
wrapMethod · 0.80
wrapNotWrappedMethod · 0.80
wrapExceptionMethod · 0.80

Calls 1

setIntMethod · 0.95

Tested by

no test coverage detected