Java classes to store data with a width that is not an integer multiple of 8 saving memory in an array of int (32 bit) or long (64 bit).
There are methods for setting and retrieving values with or without a sign and copying blocks such as java.lang.System#arraycopy.
This repository contains an Eclipse project BIT_PACKED_ARRAY with the associated files.
The Unit tests run in JUnit4.