Code example for ByteArrayOutputStream

Methods: write

0
  /** write 1 byte to the internal buffer */   
  public void writeType(byte theType) {
    byte[] aTmp = new byte[1];
    aTmp[0] = theType;
    try { 
      itsBAOS.write(aTmp);
    } catch (IOException e) {
      // nothing can happen, as nothing is 'written' - only used as buffer object       
    } 
  } 
 
  /** write a byte array to the internal buffer */ 
  public void writeBytes(byte[] theBuffer, int len) {
    try { 
      itsBAOS.write(theBuffer);
    } catch (IOException e) {
 
     //nothing can happen, as nothing is 'written' - only used as buffer object 
    }      
  }