new ByteArrayInputStream(byte[] buf, int offset, int length)
import java.io.ByteArrayInputStream; import java.io.IOException; public class Main { public static void main(String args[]) throws IOException { String tmp = "abcdefghijklmnopqrstuvwxyz"; byte b[] = tmp.getBytes(); ByteArrayInputStream input1 = new ByteArrayInputStream(b); ByteArrayInputStream input2 = new ByteArrayInputStream(b, 0, 3); } }
1. | new ByteArrayInputStream(byte[] buf) | ||
2. | ByteArrayInputStream: available() | ||
3. | ByteArrayInputStream: read(byte[] b, int off, int len) | ||
4. | ByteArrayInputStream: reset() |