----------------------------------------------------------------------------------- ByteArrayInputStream 类声明:public class ByteArrayInputStream extends InputStream位于java.io包下官方对其说明: A ByteArrayInputStream contains an internal buffer that contains byt…
public class ByteArrayTest { public static void main(String[] args) throws IOException { read(write()); } //read public static void read(byte[] b) throws IOException{ InputStream is = new BufferedInputStream(new ByteArrayInputStream(b)); byte fush[]…
package java.io; /** * A <code>ByteArrayInputStream</code> contains * an internal buffer that contains bytes that * may be read from the stream. An internal * counter keeps track of the next byte to * be supplied by the <code>read</co…
#ByteArrayInputStream 源码 ``` public synchronized int read(byte b[], int off, int len) { if (b == null) { throw new NullPointerException(); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } if (pos &…