am 89647b11: Don\'t do single byte writes in DropBoxManagerService
Merge commit '89647b1172cdf40a3681922150122b0bd2ea83f1' into gingerbread-plus-aosp * commit '89647b1172cdf40a3681922150122b0bd2ea83f1': Don't do single byte writes in DropBoxManagerService
This commit is contained in:
@@ -36,6 +36,7 @@ import android.util.Slog;
|
|||||||
|
|
||||||
import com.android.internal.os.IDropBoxManagerService;
|
import com.android.internal.os.IDropBoxManagerService;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -179,7 +180,10 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
|
|||||||
// the data in uncompressed form.
|
// the data in uncompressed form.
|
||||||
|
|
||||||
temp = new File(mDropBoxDir, "drop" + Thread.currentThread().getId() + ".tmp");
|
temp = new File(mDropBoxDir, "drop" + Thread.currentThread().getId() + ".tmp");
|
||||||
output = new FileOutputStream(temp);
|
int bufferSize = mBlockSize;
|
||||||
|
if (bufferSize > 4096) bufferSize = 4096;
|
||||||
|
if (bufferSize < 512) bufferSize = 512;
|
||||||
|
output = new BufferedOutputStream(new FileOutputStream(temp), bufferSize);
|
||||||
if (read == buffer.length && ((flags & DropBoxManager.IS_GZIPPED) == 0)) {
|
if (read == buffer.length && ((flags & DropBoxManager.IS_GZIPPED) == 0)) {
|
||||||
output = new GZIPOutputStream(output);
|
output = new GZIPOutputStream(output);
|
||||||
flags = flags | DropBoxManager.IS_GZIPPED;
|
flags = flags | DropBoxManager.IS_GZIPPED;
|
||||||
|
|||||||
Reference in New Issue
Block a user