protected void flushCacheWithAppend(final byte bufferToAppend[],final int off,final int len) throws IOException {
  final byte chunkHeader[]=EncodingUtil.getAsciiBytes(Integer.toHexString(cachePosition + len) + "\r\n");
  stream.write(chunkHeader,0,chunkHeader.length);
  stream.write(cache,0,cachePosition);
  stream.write(bufferToAppend,off,len);
  stream.write(ENDCHUNK,0,ENDCHUNK.length);
  cachePosition=0;
}

protected void flushCacheWithAppend ( final byte bufferToAppend [ ] , final int off , final int len ) throws IOException { final byte chunkHeader [ ] = EncodingUtil . getAsciiBytes ( Integer . toHexString ( cachePosition + len ) + "\r\n" ) ; stream . write ( chunkHeader , 0 , chunkHeader . length ) ; stream . write ( cache , 0 , cachePosition ) ; stream . write ( bufferToAppend , off , len ) ; stream . write ( ENDCHUNK , 0 , ENDCHUNK . length ) ; cachePosition = 0 ; }
writes the cache and buffertoappend to the underlying stream as one large chunk
