code: public static short[] longToShortArray(final long src, final int srcPos, final short[] dst, final int dstPos,
              final int nShorts) {
          if (0 == nShorts) {
              return dst;
          }
          if ((nShorts - 1) * 16 + srcPos >= 64) {
              throw new IllegalArgumentException("(nShorts-1)*16+srcPos is greater or equal to than 64");
          }
          for (int i = 0; i < nShorts; i++) {
              final int shift = i * 16 + srcPos;
              dst[dstPos + i] = (short) (0xffff & (src >> shift));
          }
          return dst;
      }
docs: <p>
  Converts a long into an array of short using the default (little endian, Lsb0) byte and
  bit ordering.
  </p>
  
  @param src the long to convert
  @param srcPos the position in {@code src}, in bits, from where to start the conversion
  @param dst the destination array
  @param dstPos the position in {@code dst} where to copy the result
  @param nShorts the number of shorts to copy to {@code dst}, must be smaller or equal to
  the width of the input (from srcPos to msb)
  @return {@code dst}
  @throws NullPointerException if {@code dst} is {@code null}
  @throws IllegalArgumentException if {@code (nShorts-1)*16+srcPos >= 64}
  @throws ArrayIndexOutOfBoundsException if {@code dstPos + nShorts > dst.length}