2016-07-24
1,bytearrayinputstream
The input source for FileInputStream is a file.
The input source of the Bytearrayinputstream is a byte array.
Reset () resets to the location of the mark tag, if the Mark method has not been called,
Reset to the starting position of the buffer (ByteArray)
Mark (int)
Packagecom.java1995;ImportJava.io.ByteArrayInputStream; Public classTestbytearrayinputstream { Public Static voidMain (string[] args) {String temp= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; byte[] B =temp.getbytes (); Bytearrayinputstream bis=NewBytearrayinputstream (b); for(inti = 0; I < 2; i++) { intC; C=Bis.read (); while(c! =-1) { if(i = = 0) {System.out.print (Char) c); } Else{System.out.print (character.touppercase (Char) (c)); } C=Bis.read (); } System.out.println (); Bis.reset (); } }}
Resources
[1] Java Easy Start Classic tutorial "full version"
Javase Advanced Section No. 09 byte array input stream Bytearrayinputstream