Encodes a response WITHOUT the frame length or header. Useful for individual parsing calls @param response The response to serialize @return A channel buffer to parse
(final GeneratedMessageLite response)
| 230 | * @return A channel buffer to parse |
| 231 | */ |
| 232 | static ChannelBuffer encodeResponse(final GeneratedMessageLite response) |
| 233 | throws Exception { |
| 234 | final int pblen = response.getSerializedSize(); |
| 235 | final int vlen = CodedOutputStream.computeRawVarint32Size(pblen); |
| 236 | final byte[] buf = new byte[vlen + pblen]; |
| 237 | final CodedOutputStream out = CodedOutputStream.newInstance(buf, 0, |
| 238 | vlen + pblen); |
| 239 | |
| 240 | out.writeMessageNoTag(response); |
| 241 | return ChannelBuffers.wrappedBuffer(buf); |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * Encodes a response with associated cells, WITHOUT the frame length or header. It should be |
no outgoing calls
no test coverage detected