Clojure

clojure.java.io/copy interprets read count of 0 as eos

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

According to the interface http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html#read()
InputStream.read() family of methods return -1 when the end of stream is reached.

do-copy methods currently use a test: (pos? size) to determine whether eos is reached. This mostly works, but the specification is pretty clear in that InputStream implementations are allowed to return reads of zero bytes before returning more bytes.

##EDIT changed title of ticket from "clojure.java.io/copy should test for -1 instead of 0 for end of stream"

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: