public final class NB extends Object
Modifier and Type | Method and Description |
---|---|
static int |
compareUInt32(int a,
int b)
Compare a 32 bit unsigned integer stored in a 32 bit signed integer.
|
static int |
decodeInt32(byte[] intbuf,
int offset)
Convert sequence of 4 bytes (network byte order) into signed value.
|
static long |
decodeInt64(byte[] intbuf,
int offset)
Convert sequence of 8 bytes (network byte order) into signed value.
|
static int |
decodeUInt16(byte[] intbuf,
int offset)
Convert sequence of 2 bytes (network byte order) into unsigned value.
|
static long |
decodeUInt32(byte[] intbuf,
int offset)
Convert sequence of 4 bytes (network byte order) into unsigned value.
|
static long |
decodeUInt64(byte[] intbuf,
int offset)
Convert sequence of 8 bytes (network byte order) into unsigned value.
|
static void |
encodeInt16(byte[] intbuf,
int offset,
int v)
Write a 16 bit integer as a sequence of 2 bytes (network byte order).
|
static void |
encodeInt32(byte[] intbuf,
int offset,
int v)
Write a 32 bit integer as a sequence of 4 bytes (network byte order).
|
static void |
encodeInt64(byte[] intbuf,
int offset,
long v)
Write a 64 bit integer as a sequence of 8 bytes (network byte order).
|
public static int compareUInt32(int a, int b)
This function performs an unsigned compare operation, even though Java does not natively support unsigned integer values. Negative numbers are treated as larger than positive ones.
a
- the first value to compare.b
- the second value to compare.public static int decodeUInt16(byte[] intbuf, int offset)
intbuf
- buffer to acquire the 2 bytes of data from.offset
- position within the buffer to begin reading from. This
position and the next byte after it (for a total of 2 bytes)
will be read.public static int decodeInt32(byte[] intbuf, int offset)
intbuf
- buffer to acquire the 4 bytes of data from.offset
- position within the buffer to begin reading from. This
position and the next 3 bytes after it (for a total of 4
bytes) will be read.public static long decodeInt64(byte[] intbuf, int offset)
intbuf
- buffer to acquire the 8 bytes of data from.offset
- position within the buffer to begin reading from. This
position and the next 7 bytes after it (for a total of 8
bytes) will be read.public static long decodeUInt32(byte[] intbuf, int offset)
intbuf
- buffer to acquire the 4 bytes of data from.offset
- position within the buffer to begin reading from. This
position and the next 3 bytes after it (for a total of 4
bytes) will be read.public static long decodeUInt64(byte[] intbuf, int offset)
intbuf
- buffer to acquire the 8 bytes of data from.offset
- position within the buffer to begin reading from. This
position and the next 7 bytes after it (for a total of 8
bytes) will be read.public static void encodeInt16(byte[] intbuf, int offset, int v)
intbuf
- buffer to write the 2 bytes of data into.offset
- position within the buffer to begin writing to. This position
and the next byte after it (for a total of 2 bytes) will be
replaced.v
- the value to write.public static void encodeInt32(byte[] intbuf, int offset, int v)
intbuf
- buffer to write the 4 bytes of data into.offset
- position within the buffer to begin writing to. This position
and the next 3 bytes after it (for a total of 4 bytes) will be
replaced.v
- the value to write.public static void encodeInt64(byte[] intbuf, int offset, long v)
intbuf
- buffer to write the 8 bytes of data into.offset
- position within the buffer to begin writing to. This position
and the next 7 bytes after it (for a total of 8 bytes) will be
replaced.v
- the value to write.Copyright © 2015 Eclipse JGit Project. All rights reserved.