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
With UTF-8 characters are encoded in a variable number of bytes according
to various ranges, as you can see here in section "Description":
http://en.wikipedia.org/wiki/UTF-8
Since you're sending your bytes as chars but read back as bytes, your last
two bytes create chars that later produce two