Refactor common network byte order decode functions to utility class
commit33e5b339a023b66860c4b6083026f186776b9f45
authorShawn O. Pearce <spearce@spearce.org>
Wed, 2 Apr 2008 00:29:31 +0000 (1 20:29 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 7 Apr 2008 05:06:37 +0000 (7 01:06 -0400)
tree6486b3923da2959ce09694529da5fcf7f07ec436
parent3166aeeba8b19eb68ed249fdb3e1b942beac7262
Refactor common network byte order decode functions to utility class

We frequently need to read a network byte order value from a byte[]
buffer, but we don't want to pay the penalty of creating a ByteBuffer
and using the stock J2SE big endian integer decode routines each
time we need to access such data.

The new "NB" utility class holds the most tuned versions of these
conversion methods that I have been able to create, and makes them
available for reuse throughout all of jgit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit.test/tst/org/spearce/jgit/lib/XInputStream.java
org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
org.spearce.jgit/src/org/spearce/jgit/lib/MutableObjectId.java
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectId.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackIndex.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexV1.java
org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexV2.java
org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java
org.spearce.jgit/src/org/spearce/jgit/util/NB.java [new file with mode: 0644]