use of java.io.BufferedWriter in project android_frameworks_base by ParanoidAndroid.
the class MediaPlayerPerformance method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
//Insert a 2 second before launching the test activity. This is
//the workaround for the race condition of requesting the updated surface.
Thread.sleep(2000);
getActivity();
if (MediaFrameworkPerfTestRunner.mGetNativeHeapDump)
MediaTestUtil.getNativeHeapDump(this.getName() + "_before");
if (MediaFrameworkPerfTestRunner.mGetProcmem) {
mProcMemWriter = new BufferedWriter(new FileWriter(new File(MEDIA_PROCMEM_OUTPUT), true));
mProcMemWriter.write(this.getName() + "\n");
}
mMemWriter = new BufferedWriter(new FileWriter(new File(MEDIA_MEMORY_OUTPUT), true));
mMemWriter.write(this.getName() + "\n");
}
use of java.io.BufferedWriter in project android_frameworks_base by ParanoidAndroid.
the class MediaRecorderStressTest method setUp.
protected void setUp() throws Exception {
final Semaphore sem = new Semaphore(0);
mLooperThread = new Thread() {
@Override
public void run() {
Log.v(TAG, "starting looper");
Looper.prepare();
mHandler = new Handler();
sem.release();
Looper.loop();
Log.v(TAG, "quit looper");
}
};
mLooperThread.start();
if (!sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
fail("Failed to start the looper.");
}
//Insert a 2 second before launching the test activity. This is
//the workaround for the race condition of requesting the updated surface.
Thread.sleep(2000);
getActivity();
super.setUp();
File stressOutFile = new File(String.format("%s/%s", Environment.getExternalStorageDirectory(), MEDIA_STRESS_OUTPUT));
mOutput = new BufferedWriter(new FileWriter(stressOutFile, true));
mOutput.write(this.getName() + "\n");
}
use of java.io.BufferedWriter in project android_frameworks_base by ParanoidAndroid.
the class CameraStressTest method setUp.
protected void setUp() throws Exception {
final Semaphore sem = new Semaphore(0);
mLooperThread = new Thread() {
@Override
public void run() {
Log.v(TAG, "starting looper");
Looper.prepare();
mHandler = new Handler();
sem.release();
Looper.loop();
Log.v(TAG, "quit looper");
}
};
mLooperThread.start();
if (!sem.tryAcquire(WAIT_TIMEOUT, TimeUnit.MILLISECONDS)) {
fail("Failed to start the looper.");
}
getActivity();
super.setUp();
mCameraTestHelper = new CameraTestHelper();
File stressOutFile = new File(String.format("%s/%s", Environment.getExternalStorageDirectory(), CAMERA_STRESS_OUTPUT));
mOutput = new BufferedWriter(new FileWriter(stressOutFile, true));
mOutput.write(this.getName() + "\n");
}
use of java.io.BufferedWriter in project android_frameworks_base by ParanoidAndroid.
the class VideoEditorStressTest method writeTestCaseHeader.
private void writeTestCaseHeader(String testCaseName) throws Exception {
File outFile = new File(VIDEOEDITOR_OUTPUT);
Writer output = new BufferedWriter(new FileWriter(outFile, true));
output.write("\n\n" + testCaseName + "\n");
output.close();
}
use of java.io.BufferedWriter in project generator by mybatis.
the class MyBatisGenerator method writeFile.
/**
* Writes, or overwrites, the contents of the specified file.
*
* @param file
* the file
* @param content
* the content
* @param fileEncoding
* the file encoding
* @throws IOException
* Signals that an I/O exception has occurred.
*/
private void writeFile(File file, String content, String fileEncoding) throws IOException {
FileOutputStream fos = new FileOutputStream(file, false);
OutputStreamWriter osw;
if (fileEncoding == null) {
osw = new OutputStreamWriter(fos);
} else {
osw = new OutputStreamWriter(fos, fileEncoding);
}
BufferedWriter bw = new BufferedWriter(osw);
bw.write(content);
bw.close();
}
Aggregations