有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    我想说清楚:

    write()是一个潜在的阻塞调用,它将数据放入行的缓冲区以呈现。也就是说,该行可能会在未来某个时间呈现数据。从docs开始:

    The requested number of bytes of data are read from the specified array, starting at the given offset into the array, and written to the data line's buffer.

    getMicrosecondPosition ()告诉您已经渲染了多少微秒,docs

    The microsecond position measures the time corresponding to the number of sample frames captured by, or rendered from, the line since it was opened.

    这两种方法都应该是线程安全的,因为Javadocs中没有警告