Extract DevNull OutputStream to its own class
Extract DevNull to its own class, so that it can be used by other classes.
This commit is contained in:
parent
3a718cc92c
commit
431724ce14
|
@ -0,0 +1,18 @@
|
|||
package ctbrec;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class DevNull extends OutputStream {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
}
|
||||
}
|
|
@ -1,13 +1,12 @@
|
|||
package ctbrec.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.DevNull;
|
||||
import ctbrec.Recording;
|
||||
import ctbrec.recorder.OS;
|
||||
import ctbrec.recorder.StreamRedirectThread;
|
||||
|
@ -48,6 +47,7 @@ public class Player {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static class PlayerThread extends Thread {
|
||||
private boolean running = false;
|
||||
private Process playerProcess;
|
||||
|
@ -113,18 +113,4 @@ public class Player {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class DevNull extends OutputStream {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b) throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue