File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
src/main/java/com/github/myibu/algorithm/data Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
26
26
27
27
group = ' com.github.myibu'
28
28
archivesBaseName = " algorithm-java"
29
- version = " 1.0.0f "
29
+ version = " 1.0.0g "
30
30
31
31
repositories {
32
32
mavenCentral()
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ Reference to: [HoffmanAndGolombCoding.pdf](./docs/HoffmanAndGolombCoding.pdf)
57
57
< dependency>
58
58
< groupId> com.github.myibu< /groupId>
59
59
< artifactId> algorithm-java< /artifactId>
60
- < version> 1.0.0f < /version>
60
+ < version> 1.0.0g < /version>
61
61
< /dependency>
62
62
```
63
63
Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ public static Bits ofByte(byte val, int len) {
273
273
}
274
274
275
275
public static Bits ofByte (byte [] val ) {
276
+ if (val == null || val .length == 0 ) return new Bits ();
276
277
int i = 0 ;
277
278
Bits first = ofByte (val [i ++]);
278
279
for (; i < val .length ; i ++) {
@@ -300,6 +301,7 @@ public static Bits ofShort(short val, int len) {
300
301
}
301
302
302
303
public static Bits ofShort (short [] val ) {
304
+ if (val == null || val .length == 0 ) return new Bits ();
303
305
int i = 0 ;
304
306
Bits first = ofShort (val [i ++]);
305
307
for (; i < val .length ; i ++) {
@@ -327,6 +329,7 @@ public static Bits ofInt(int val, int len) {
327
329
}
328
330
329
331
public static Bits ofInt (int [] val ) {
332
+ if (val == null || val .length == 0 ) return new Bits ();
330
333
int i = 0 ;
331
334
Bits first = ofInt (val [i ++]);
332
335
for (; i < val .length ; i ++) {
@@ -406,6 +409,7 @@ public static Bits ofLong(long val, int len) {
406
409
}
407
410
408
411
public static Bits ofLong (long [] val ) {
412
+ if (val == null || val .length == 0 ) return new Bits ();
409
413
int i = 0 ;
410
414
Bits first = ofLong (val [i ++]);
411
415
for (; i < val .length ; i ++) {
You can’t perform that action at this time.
0 commit comments