public void write(InputStream stream){
  if (isFinal) {
    log.warning("attempting to write to a final SpeechData object");
    return;
  }
  try {
    int nRead;
    byte[] buffer=new byte[1024 * 16];
    while ((nRead=stream.read(buffer,0,buffer.length)) != -1) {
      byte[] newData=new byte[data.length + nRead];
      System.arraycopy(data,0,newData,0,data.length);
      System.arraycopy(buffer,0,newData,data.length,nRead);
      data=newData;
    }
  }
 catch (  IOException e) {
    log.warning("Cannot write the stream to the speech data");
  }
}

public void write ( InputStream stream ) { if ( isFinal ) { log . warning ( "attempting to write to a final SpeechData object" ) ; return ; } try { int nRead ; byte [ ] buffer = new byte [ 1024 * 16 ] ; while ( ( nRead = stream . read ( buffer , 0 , buffer . length ) ) != - 1 ) { byte [ ] newData = new byte [ data . length + nRead ] ; System . arraycopy ( data , 0 , newData , 0 , data . length ) ; System . arraycopy ( buffer , 0 , newData , data . length , nRead ) ; data = newData ; } } catch ( IOException e ) { log . warning ( "Cannot write the stream to the speech data" ) ; } }
expands the current speech data by appending the data in the input stream .
