Added JRuby specific code in bin/read-write