title: Bytearray vs Intarray
body: <p>Please help to understand my java basics</p>
  
  <p>I understand that bytes primitive can store values from -127 to 127  = So only Ascii values can be stored in byte primitive or Byte Array.
  We generally store image,music and audio files in byte primitive or Byte Array as these files contains values between -127 to 127.
  Cannot store Unicode values in byte array as these values can be upto 65536 - </p>
  
  <ol>
  <li><p>Why we generally prefer to store bytes read from files in to bytearray?..why not into int array?</p></li>
  <li><p>I have Chinese characters in a word document.
  I using inputstream (as opposed to reader class) to read the doc file and make a copy of it. Inputstream is read in to byte array and from there it is written to output file. 
  Chinese characters have more value than 128, so how those are stored in byte array? I had thought we should use only reader class(not INPUTSTREAM) to read word documents that has UNICODE characters.</p>
  
  <pre><code>final String file="E:\\Users\\17496382.WUDIP\\Desktop\\chin.doc";
  final String file1="E:\\Users\\17496382.WUDIP\\Desktop\\chin1.doc";
  
  InputStream inputStream = new FileInputStream(file); 
  OutputStream out = new FileOutputStream(file1);
  byte[] buffer = new byte[1024];
  
  int bytesRead;
  while((bytesRead = inputStream.read(buffer))!=-1) {
      out.write(buffer);
      System.out.println(Arrays.toString(buffer));
  }
  </code></pre></li>
  </ol>