|
|
Input and Output Streams |
UseByteArrayInputStreamand
ByteArrayOutputStreamto read and write 8-bit data. Create these streams on an existing byte array and then use the
readandwritemethods to read from or write data to the array in memory.Use
StringBufferInputStreamto read data from a
StringBuffer. Create aStringBufferInputStreamon an existingStringBufferobject and then use thereadmethod to read from theStringBufferas it lives in memory. This stream is similar to theByteArrayInputStreamwhich reads 8-bit data from a byte array in memory butStringBufferInputStreamreads 16-bit Unicode data from a string buffer in memory. Thejava.iopackage does not have a partner output stream forStringBufferInputStream--use theStringBufferclass directly instead.
|
|
Input and Output Streams |