I found a discrepancy between how JRuby (1.7.12) and MRI (1.9.3, 2.1.1) read 0 bytes from a socket. Consider this example:
require 'socket'
socket = TCPSocket.new('127.0.0.1', 80)
socket.read(0)
In JRuby 1.7.12, this code blocks the caller.
In MRI 1.9.3 and 2.1.1, this code immediately returns an empty string.