Demonstrate ByteArrayInputStream : ByteArrayInputStream « File Input Output « Java






Demonstrate ByteArrayInputStream

    


import java.io.ByteArrayInputStream;
import java.io.IOException;

class ByteArrayInputStreamDemo {
  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);
  }
}


   
    
    
  








Related examples in the same category

1.Byte Array IO
2.Convert string into InputStream using ByteArrayInputStream class.
3.ByteArrayInputStream Reset
4.Read ByteArrayInputStream to String
5.ByteArrayInputStream implementation that does not synchronize methods.
6.Fast Multi ByteArrayInputStream