protected void writeImpl(short[] samples, int offs, int len)
            throws JavaLayerException {
        if (source == null) {
            createSource();
        }

        byte[] b = toByteArray(samples, offs, len);
        source.write(b, 0, len * 2);
    }