title: ByteArrayOutputStream capacity restriction
body: <p>I create <code>ByteArrayOutputStream barr = new ByteArrayOutputStream(1);</code>, i.e. with capacity 1 bytes and write to it more than 1 byte <code>barr.write("123456789000000".getBytes());</code>. No error occurs, I check the length of <code>barr</code> it is 15. Why my writing was not blocked or wrapped? Is there a way to prevent of writing more than capacity and which <code>outputstream</code> could be used for that?
  I am very limited in available memory and don`t want to write there more than my limitations define</p>
  
  <p><strong>P.S.</strong> 
  Thanks a lot for the answers! I had a following up <a href="https://stackoverflow.com/questions/33018984/writing-to-outputstream-having-capacity-restriction">question</a>
  It could be great if you could look</p>