diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-09-22 18:33:46 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-22 18:33:46 -0700 |
commit | 1c3846979a657e4e2b1f7864fa6defb65b3bbf42 (patch) | |
tree | 80ec331b8b4000bd8748fc4736a6ac7f7973a37d /services | |
parent | 19c4b29d46aece70dbe532ba9078c904fbc62502 (diff) | |
parent | 89647b1172cdf40a3681922150122b0bd2ea83f1 (diff) | |
download | frameworks_base-1c3846979a657e4e2b1f7864fa6defb65b3bbf42.zip frameworks_base-1c3846979a657e4e2b1f7864fa6defb65b3bbf42.tar.gz frameworks_base-1c3846979a657e4e2b1f7864fa6defb65b3bbf42.tar.bz2 |
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
Diffstat (limited to 'services')
-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; |