diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-06-24 13:46:13 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2013-06-24 18:16:48 -0700 |
commit | 8c84109b9fbbf473b225707a38261ff5f99d95fb (patch) | |
tree | 9796143a5fb2980d58612a247a737448a428f742 /location/lib/java/com | |
parent | 3af16b226b8467100091b4e02fc3e70a002d567e (diff) | |
download | frameworks_base-8c84109b9fbbf473b225707a38261ff5f99d95fb.zip frameworks_base-8c84109b9fbbf473b225707a38261ff5f99d95fb.tar.gz frameworks_base-8c84109b9fbbf473b225707a38261ff5f99d95fb.tar.bz2 |
Use FastPrintWriter... everywhere.
One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result. Now
you need to first flush the FastPrintWriter.
Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.
Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
Diffstat (limited to 'location/lib/java/com')
-rw-r--r-- | location/lib/java/com/android/location/provider/LocationProviderBase.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/location/lib/java/com/android/location/provider/LocationProviderBase.java b/location/lib/java/com/android/location/provider/LocationProviderBase.java index 8a5a739..150c289 100644 --- a/location/lib/java/com/android/location/provider/LocationProviderBase.java +++ b/location/lib/java/com/android/location/provider/LocationProviderBase.java @@ -35,6 +35,7 @@ import android.util.Log; import com.android.internal.location.ILocationProvider; import com.android.internal.location.ProviderProperties; import com.android.internal.location.ProviderRequest; +import com.android.internal.util.FastPrintWriter; /** * Base class for location providers implemented as unbundled services. @@ -106,7 +107,7 @@ public abstract class LocationProviderBase { } @Override public void dump(FileDescriptor fd, String[] args) { - PrintWriter pw = new PrintWriter(new FileOutputStream(fd)); + PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd)); onDump(fd, pw, args); pw.flush(); } |