Skip to content

Commit dececa5

Browse files
author
Jin Kwon
committed
Squash sketch
1 parent 3c32b7f commit dececa5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/java/com/github/jinahya/bit/io/BitIoConstants.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
package com.github.jinahya.bit.io;
22

3+
/**
4+
* Defines constants for bit-io.
5+
*
6+
* @author Jin Kwon <onacit_at_gmail.com>\
7+
*/
38
final class BitIoConstants {
49

10+
/**
11+
* An array of pre-initialized bit masks.
12+
*/
513
private static final int[] MASKS = new int[8];
614

715
static {
@@ -12,10 +20,19 @@ final class BitIoConstants {
1220
}
1321
}
1422

23+
/**
24+
* Returns a bit mask for specified bit size.
25+
*
26+
* @param size the number of bits to mask.
27+
* @return a bit mask.
28+
*/
1529
static int mask(final int size) {
1630
return MASKS[size - 1];
1731
}
1832

33+
/**
34+
* Creates a new instance.
35+
*/
1936
private BitIoConstants() {
2037
throw new AssertionError("initialization is not allowed");
2138
}

0 commit comments

Comments
 (0)