Add CreateByteReader to avoid type assertions on every read.
Improve VarInt and VarLong write. (ported from Velocity, this part of code is licensed under MIT by the author)
I've unrolled the loop for VarInt (like what Velocity has done), but kept the loop for VarLong because it's probably too long, and VarInt is used more often than VarLong. Should I also unroll it?
Few things optimized:
encoding/binary
for binary conversions.CreateByteReader
to avoid type assertions on every read.I've unrolled the loop for VarInt (like what Velocity has done), but kept the loop for VarLong because it's probably too long, and VarInt is used more often than VarLong. Should I also unroll it?