Skip to content

File-to-file transfer fails #12

Closed
Closed
@lynaghk

Description

@lynaghk

This is with

                 [byte-transforms "0.1.1"
                  :exclusions [byte-streams]]
                 [byte-streams "0.1.7"]

Trying to copy from one file to another fails:

(bs/transfer (File. "test/fixture/kittensB/kitten1.jpg")
             (File/createTempFile "difftron" "image-diff"))

yields

sun.nio.ch.FileChannelImpl cannot be cast to java.lang.Number
  [Thrown class java.lang.ClassCastException]

Restarts:
 0: [QUIT] Quit to the SLIME top level

Backtrace:
  0:        byte_streams.clj:699 byte-streams/eval4829[fn]
  1:        byte_streams.clj:425 byte-streams/this[fn]
  2:        byte_streams.clj:465 byte-streams/transfer
  3:        byte_streams.clj:460 byte-streams/transfer
  4: form-init6519885573008950383.clj:1 com.keminglabs.difftron.image-diff/eval11751

However, converting first to a byte-buffer works fine:

(bs/transfer (bs/to-byte-buffer (File. "test/fixture/kittensB/kitten1.jpg"))
             (File. "foo.jpg"))
=> nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions