The position within the underlying byte[] is maintained so that each write call will append the next encoded value in the byte[].
The underlying byte[] is resized when it is not large enough to contain the next value to be written.
This implementation (especially #writeUTF()) is based on (and some pieces are copied from) the work done by Lucene in the methods UTF16toUTF8
and UTF8toUTF16
in org.apache.lucene.util.UnicodeUtil.java
(revision 1030754), and combined with the work done by ElasticSearch in org.elasticsearch.common.io.stream.BytesStreamInput.java
, org.elasticsearch.common.io.stream.BytesStreamOutput.java
, org.elasticsearch.common.io.stream.StreamInput.java
, org.elasticsearch.common.io.stream.StreamOutput.java
.
|
|
|
|