static byte[] toByteArray(short[] shortArray) {
            byte[] primitivesArray = new byte[shortArray.length * 2];
            ByteBuffer buffer = ByteBuffer.allocate(2);
            for (int i = 0; i < shortArray.length; i++) {
                buffer.clear();