summaryrefslogtreecommitdiff
path: root/opengl/libagl/array.cpp
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2009-06-01 10:53:06 +0100
committerBjorn Bringert <bringert@android.com>2009-06-03 12:53:42 +0100
commitc1823701cc76790494fb622fe58f0942236cd7d0 (patch)
tree4732327a73e57fa5ad55e1724d79fbbf35654141 /opengl/libagl/array.cpp
parent963cd006c45716b034f656bf7e7179e6476f7e4d (diff)
Handle EOF correctly in MemoryFile input stream.
Before, the variants of MemoryFile.MemoryInputStream.read() would throw IOException or IndexOutOfBoundsException if EOF was encountered before the requested number of bytes was read. This violates the contract of InputStream.read(). This patch makes read() return the number of bytes available, if any. If already at EOF, -1 is returned. The patch also adds new tests, which checks cases where MemoryFile.MemoryInputStream.read() should throw IndexOutOfBoundsException or return -1. several of these tests failed with the old code and pass now. This fixes http://b/issue?id=1881894
Diffstat (limited to 'opengl/libagl/array.cpp')
0 files changed, 0 insertions, 0 deletions