Reprint please indicate source: http://www.cnblogs.com/lighten/p/7082668.html
1. Preface
This chapter introduces the character array flow, the function and the Bytearrayinputstream byte array flow is the same, so the introduction is relatively simple, the front has seen, you can skip directly, no difficulty.
2.CharArrayReader
It has a cached character array, the current read position, the marker bit and the total data length, and accepts a character array as the input source. That's the cache. The read is then read to the accepted data.
The Read method, if the current position is greater than or equal to the total data length, means that the read is finished, returns 1, otherwise returns the position of buf[], position +1;
Read the array and simply judge the copy.
Skip is the POS shift. The premise is that there are so many bits that can be moved. Other methods are not introduced.
3.CharArrayWriter
This class is even simpler, which is to write the characters to the built-in buf, counting the count. The default buf size is 32.
Write, not enough to increase by one times. Copy.
This method is to write the existing data to a writer, note that no buf is not reset.
Returns the data currently written. The other close and flush methods are empty methods. The rest is nothing to say.
Java IO (12) CharArrayReader and Chararraywriter