question: protected void writeStroke ( Stroke stroke ) throws IOException { if ( stroke instanceof BasicStroke ) { BasicStroke ns = ( BasicStroke ) stroke ; int currentCap = - 1 , currentJoin = - 1 ; float currentWidth = - 1 , currentLimit = - 1 , currentDashPhase = - 1 ; float [ ] currentDashArray = null ; if ( ( currentStroke != null ) && ( currentStroke instanceof BasicStroke ) ) { BasicStroke cs = ( BasicStroke ) currentStroke ; currentCap = cs . getEndCap ( ) ; currentJoin = cs . getLineJoin ( ) ; currentWidth = cs . getLineWidth ( ) ; currentLimit = cs . getMiterLimit ( ) ; currentDashArray = cs . getDashArray ( ) ; currentDashPhase = cs . getDashPhase ( ) ; } float width = ns . getLineWidth ( ) ; writeWidth ( width ) ; int cap = ns . getEndCap ( ) ; if ( currentCap != cap ) { writeCap ( cap ) ; } int join = ns . getLineJoin ( ) ; if ( currentJoin != join ) { writeJoin ( join ) ; } float limit = ns . getMiterLimit ( ) ; if ( ( currentLimit != limit ) && ( limit >= 1.0f ) ) { writeMiterLimit ( limit ) ; } if ( ns . getDashArray ( ) != null ) { writeDash ( ns . getDashArray ( ) , ns . getDashPhase ( ) ) ; } else { writeDash ( new float [ 0 ] , ns . getDashPhase ( ) ) ; } } }
target:  Writes the current stroke. If stroke is an instance of BasicStroke it will call writeWidth, writeCap, writeJoin, writeMiterLimit and writeDash, if any were different than the current stroke.