IO#read with buffer length greater than first argument causes
ArrayIndexOutOfBoundsException
--------------------------------------------------------------------------------------------
Key: JRUBY-2153
URL: http://jira.codehaus.org/browse/JRUBY-2153
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1RC2
Environment: Windows XP Pro, Java 1.5
Reporter: Daniel Berger
Passing a buffer that's longer than the first argument to IO#read causes
anArrayIndexOutOfBoundsException.
This code demonstrates the problem. The test.txt file I used contains the text
'hello' and 'world' (two lines) and that's all.
{noformat}
buffer = ' ' # string of 6 characters or more
fh = File.open('test.txt')
fh.read(5, buffer)
p buffer
fh.close
{noformat}
If you set the buffer to any string of size 5 or less it works fine
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email