Skip to content

Instantly share code, notes, and snippets.

@tk2217
tk2217 / Buffers.java
Last active March 5, 2022 22:11
A semi-optimized java class to work with varints.
package com.tk2217.util;
import io.netty.buffer.ByteBuf;
public class VarInts {
/* Bazel varint reading routines
* https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/VarInt.java
* Licensed under the Apache License 2.0.
* Slightly modified to use a `ByteBuf`.
*/