Hi,
Am Donnerstag, 8. Mai 2014 07:41:48 UTC+2 schrieb Dylan Gleason:
>
> *(defn- receive*
> * "Given a socket create a DataInputStream and process the server*
> * response"*
> * [reader socket]*
> * (let [bytes-in (make-array Byte/TYPE util/max-message-size)*
> * info {:type :receive :socket socket :count
> util/max-message-size}]*
> * (log info)*
> * (.read reader bytes-in 0 util/max-message-size)*
> * bytes-in))*
>
Inputstream#read will not necessarily read all bytes from an input stream.
See
http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#read(byte[],
int, int)
This question on SO might
help:
https://stackoverflow.com/questions/23018870/how-to-read-a-whole-binary-file-nippy-into-byte-array-in-clojure
-billy.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.