diff options
-rw-r--r-- | services/java/com/android/server/DropBoxManagerService.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/java/com/android/server/DropBoxManagerService.java b/services/java/com/android/server/DropBoxManagerService.java index 14b7d3e..9829f9a 100644 --- a/services/java/com/android/server/DropBoxManagerService.java +++ b/services/java/com/android/server/DropBoxManagerService.java @@ -36,6 +36,7 @@ import android.util.Slog; import com.android.internal.os.IDropBoxManagerService; +import java.io.BufferedOutputStream; import java.io.File; import java.io.FileDescriptor; import java.io.FileOutputStream; @@ -179,7 +180,10 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub { // the data in uncompressed form. 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)) { output = new GZIPOutputStream(output); flags = flags | DropBoxManager.IS_GZIPPED; |