static void javaSound_streamFromLineToLine(TargetDataLine in, SourceDataLine out, int bufferSize, Flag stopFlag) { byte[] buf = new byte[bufferSize]; while (licensed() && !stopFlag.isUp()) out.write(buf, 0, in.read(buf, 0, bufferSize)); }