summaryrefslogtreecommitdiffstats
path: root/dalvik/src/main
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-03-25 19:18:42 -0700
committerElliott Hughes <enh@google.com>2011-03-25 19:54:20 -0700
commit78c7cc547101002b9f9043cf3845970719d1bda8 (patch)
tree6b7390d28bd9b163b98285237779a6284e394a0c /dalvik/src/main
parentda5f38a51f56f38070e6efc1bdf9176004dd828d (diff)
downloadlibcore-78c7cc547101002b9f9043cf3845970719d1bda8.zip
libcore-78c7cc547101002b9f9043cf3845970719d1bda8.tar.gz
libcore-78c7cc547101002b9f9043cf3845970719d1bda8.tar.bz2
Add write(2).
Note that this is a functional change, because the old code was wrong: it assumed that short writes don't happen. I thought we'd (I'd) cleaned this up just recently, but it looks like I must have only gone through the network code. Embarrassing. This also cleans up the previous read change a bit, factoring out a bit more duplication, and taking advantage of the fact that we now get decent exceptions thrown from invalid FileDescriptors (meaning we can remove explicit checks). Bug: 3107501 Change-Id: I8bd5324836c9d151dceaef5b84ec523a67391b64
Diffstat (limited to 'dalvik/src/main')
-rw-r--r--dalvik/src/main/java/dalvik/system/BlockGuard.java12
1 files changed, 0 insertions, 12 deletions
diff --git a/dalvik/src/main/java/dalvik/system/BlockGuard.java b/dalvik/src/main/java/dalvik/system/BlockGuard.java
index a0c0d25..136bdc1 100644
--- a/dalvik/src/main/java/dalvik/system/BlockGuard.java
+++ b/dalvik/src/main/java/dalvik/system/BlockGuard.java
@@ -166,12 +166,6 @@ public final class BlockGuard {
mFileSystem = fileSystem;
}
- public long write(int fileDescriptor, byte[] bytes, int offset, int length)
- throws IOException {
- BlockGuard.getThreadPolicy().onWriteToDisk();
- return mFileSystem.write(fileDescriptor, bytes, offset, length);
- }
-
public long readv(int fileDescriptor, int[] addresses, int[] offsets,
int[] lengths, int size) throws IOException {
BlockGuard.getThreadPolicy().onReadFromDisk();
@@ -184,12 +178,6 @@ public final class BlockGuard {
return mFileSystem.writev(fileDescriptor, addresses, offsets, lengths, size);
}
- public long writeDirect(int fileDescriptor, int address, int offset,
- int length) throws IOException {
- BlockGuard.getThreadPolicy().onWriteToDisk();
- return mFileSystem.writeDirect(fileDescriptor, address, offset, length);
- }
-
public long transfer(int fileHandler, FileDescriptor socketDescriptor,
long offset, long count) throws IOException {
return mFileSystem.transfer(fileHandler, socketDescriptor, offset, count);