@Override
    public byte[] getBytes() {
        switch (length) {
            case 1:
                return new byte[]{value.byteValue()};
            case 2:
                return ByteBuffer.allocate(getLength()).order(LITTLE_ENDIAN).putShort(value.shortValue()).array();
            case 4:
                return ByteBuffer.allocate(getLength()).order(LITTLE_ENDIAN).putInt(value).array();
            default:
                throw new IllegalArgumentException("Invalid length");
        }
    }
TimeSecond 8, 16, 32 characteristic

@param timeSecond time in seconds
mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/TimeSecond.java