Hanlde empty objects by encoding them all as NULL
Throw endOfInput condition on 0 length read

  -- doesn't happen actually, R throws an error here with blocking
     connection.