MCPcopy Index your code
hub / github.com/google/brotli / bytesToNibbles

Method bytesToNibbles

java/org/brotli/dec/BitReader.java:295–313  ·  view source on GitHub ↗

Translates bytes to halves (int/short).

(State s, int byteLen)

Source from the content-addressed store, hash-verified

293 * Translates bytes to halves (int/short).
294 */
295 static void bytesToNibbles(State s, int byteLen) {
296 final byte[] byteBuffer = s.byteBuffer;
297 final int halfLen = byteLen >> LOG_HALF_SIZE;
298 if (BITNESS == 64) {
299 final int[] intBuffer = s.intBuffer;
300 for (int i = 0; i < halfLen; ++i) {
301 intBuffer[i] = ((int) byteBuffer[i * 4] & 0xFF)
302 | (((int) byteBuffer[(i * 4) + 1] & 0xFF) << 8)
303 | (((int) byteBuffer[(i * 4) + 2] & 0xFF) << 16)
304 | (((int) byteBuffer[(i * 4) + 3] & 0xFF) << 24);
305 }
306 } else {
307 final short[] shortBuffer = s.shortBuffer;
308 for (int i = 0; i < halfLen; ++i) {
309 shortBuffer[i] = (short) (((int) byteBuffer[i * 2] & 0xFF)
310 | (((int) byteBuffer[(i * 2) + 1] & 0xFF) << 8));
311 }
312 }
313 }
314}

Callers 1

readMoreInputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected