History log of /libcore/luni/src/test/java/libcore/java/io/FileInputStreamTest.java
Revision Date Author Comments
b1f55cb6f95928be969a8fe5c7447e13f14d0a68 19-Jul-2011 Elliott Hughes <enh@google.com> Fix FileInputStream/FileOutputStream on unowned FileDescriptors.

We were relying on the fd being invalid to prevent us from performing
activity on a closed stream. Unfortunately, this didn't work with our
clever scheme to avoid having to treat the two cases separately.

Go back to a simple scheme with one FileDescriptor and a boolean that
tells us whether or not we should close it. If we don't close it, we
switch it out for an invalid FileDescriptor so we won't continue to
act on the unowned FileDescriptor.

Bug: 4361076
Change-Id: I1851926fd2847ea63d91a8e0680a7430ecb16453
73298fc8f21a2440b4848912e95a072713b93a1a 07-Apr-2011 Elliott Hughes <enh@google.com> Fix a typo in FileOutputStream.

The matching code in FileInputStream was correct, but I've added tests for
both. Note that the RI does not pass these tests; this was always an Android
extension, one which we'd apparently never written a test for.

Change-Id: I04d0f63839f07e8ff4ad7b3d54a31b0c0955f8d1
462bdac45c10f43d88d8f07f6994e272a27c14a2 30-Mar-2011 Elliott Hughes <enh@google.com> Add close(2).

This is sufficient for non-socket fds, but may need to change to support the
asynchronous socket close monitor. (Hopefully not; I'd rather lift that into
Java.)

I've also changed the semantics of IoUtils.close to match those desired by
all callers: ignore null/invalid FileDescriptors.

Bug: 3107501
Change-Id: Iad5c31c8f0f34d2a5ab1ed4581509b46af28bd1f
41f0605d2c809bd9bc1c0fb68d86b49a0f59b6c5 24-Mar-2011 Elliott Hughes <enh@google.com> Add pipe(2).

This lets us kill quite a bit of IoUtils.

Bug: 3107501
Change-Id: Ic8a297b29cc53a17841cc77e266cd8dc3910c521
0ac77ac8e915bff1a863e371f9b363033f9cf759 23-Mar-2011 Elliott Hughes <enh@google.com> Add open(2).

Bug: 3107501
Change-Id: I404030b4c678862465d04f723a6a324663e0af25
0f524004b71b732c888d10eab57008bc65d8a3e0 20-Jan-2011 Owen Lin <owenlin@google.com> Skip bytes by reading if the file is not seekable.

And also add unit test for FileInputStream.skip() for a pipe.

bug: 3298498

Change-Id: Iceecdd42654700e00f15b53759a3761e1c4da943