Resolved.
I overlooked that OutputStream has
void write(byte[] b, int off, int len)
.
With write(byte[] ...) of OutputStream instead of write(char[] ...) of
BufferedWritersends I can send the bytes that I want to send.
Code:
(require '[clojure.java.io :refer :all])
(with-open [s (java.net
Armando, thank you for your reply.
Writing single value with
void write(int c)
sends same 2 bytes for values larger than 127 as using
void write(char[] cbuf, int off, int len)
of BufferedReader
http://docs.oracle.com/javase/jp/6/api/java/io/BufferedWriter.html
Code:
(require '[clojure.java
ter produce two bytes each, and thus you see
seven bytes at the other end. You may want to get an output stream from the
socket and write single bytes directly.
On Wednesday, August 28, 2013 7:13:31 PM UTC-7, Yoshinori Kohyama wrote:
> Hello all.
>
> Please help me to read and write b
Hello all.
Please help me to read and write bytes via Socket.
For example, assumed that I want to send 5 bytes [0x00, 0x01, 0x7f, 0x80,
0xff] to a TCP server.
I did:
(require '[clojure.java.io :refer :all])
(with-open [s (java.net.Socket. "*ip.of.test.server*" *port_of_test_se