java varint

varint implementation in java.

License

License

GroupId

GroupId

com.zmannotes
ArtifactId

ArtifactId

varint
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

java varint
varint implementation in java.
Project URL

Project URL

https://github.com/zman2013/varint
Source Code Management

Source Code Management

https://github.com/zman2013/varint

Download varint

How to add to project

<!-- https://jarcasting.com/artifacts/com.zmannotes/varint/ -->
<dependency>
    <groupId>com.zmannotes</groupId>
    <artifactId>varint</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.zmannotes/varint/
implementation 'com.zmannotes:varint:1.0.0'
// https://jarcasting.com/artifacts/com.zmannotes/varint/
implementation ("com.zmannotes:varint:1.0.0")
'com.zmannotes:varint:jar:1.0.0'
<dependency org="com.zmannotes" name="varint" rev="1.0.0">
  <artifact name="varint" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.zmannotes', module='varint', version='1.0.0')
)
libraryDependencies += "com.zmannotes" % "varint" % "1.0.0"
[com.zmannotes/varint "1.0.0"]

Dependencies

test (3)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.2.3
junit : junit jar 4.12
org.mockito : mockito-core jar 3.1.0

Project Modules

There are no modules declared in this project.

Travis Build Coverage Status

varint

A java implementation of the varint

Getting started

Setting up the dependency

  • Gradle
implementation "com.zmannotes:varint:1.0.0"
  • Maven
<dependency>
    <groupId>com.zmannotes</groupId>
    <artifactId>varint</artifactId>
    <version>1.0.0</version>
</dependency>

example

    int origin = 1234774;

    ByteBuffer byteBuffer = ByteBuffer.allocate(10);
    VarInt.writeVarInt(origin, byteBuffer);

    byteBuffer.flip();

    int fin = VarInt.readVarint(byteBuffer);

    Assert.assertEquals(origin, fin);

Versions

Version
1.0.0