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:
0xboobface 2018-08-28 12:57:55 +02:00
parent 3a718cc92c
commit 431724ce14
2 changed files with 21 additions and 17 deletions

View File

@ -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 {
}
}

View File

@ -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 {
}
}
}
}