Array.prototype.indexOf并Date.now已在 ES5 中引入。如果我编译存储在文件 test.ts 中的以下代码,为什么 Typescript 不转译?
Date.now();
[1,2,3].indexOf(2);
Run Code Online (Sandbox Code Playgroud)
我使用的命令是tsc -t es3 test.ts. 生成的 test.js 与 test.ts 完全相同。
我试图通过使用Linux下的ProcessBuilder类将mp3文件解码为wav文件.由于某种原因,该过程不会停止,因此我必须手动取消它.
有人可以给我一个暗示.我认为引用的代码很容易重现:
import java.io.*;
public class Test {
public static void main(String[] args) {
try {
Process lameProcess = new ProcessBuilder("lame", "--decode", "test.mp3", "-").start();
InputStream is = lameProcess.getInputStream();
FileOutputStream fileOutput = new FileOutputStream("test.wav");
DataOutputStream dataOutput = new DataOutputStream(fileOutput);
byte[] buf = new byte[32 * 1024];
int nRead = 0;
int counter = 0;
while((nRead = is.read(buf)) != -1) {
dataOutput.write(buf, 0, buf.length);
}
is.close();
fileOutput.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
输出jstack
"main" prio=10 tid=0x0000000002588800 nid=0x247a runnable …Run Code Online (Sandbox Code Playgroud)