MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / ensureReadable

Method ensureReadable

src/RegionClient.java:1595–1599  ·  view source on GitHub ↗

Ensures that at least a nbytes are readable from the given buffer. If there aren't enough bytes in the buffer this will raise an exception and cause the ReplayingDecoder to undo whatever we did thus far so we can wait until we read more from the socket. @param buf Buffer to check. @p

(final ChannelBuffer buf, final int nbytes)

Source from the content-addressed store, hash-verified

1593 * @param nbytes Number of bytes desired.
1594 */
1595 private static void ensureReadable(final ChannelBuffer buf, final int nbytes) {
1596 buf.markReaderIndex();
1597 buf.skipBytes(nbytes);
1598 buf.resetReaderIndex();
1599 }
1600
1601 /**
1602 * De-serializes an RPC response.

Callers 5

decodeMethod · 0.95
deserializeMethod · 0.95
parseResultsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected