@ Override public int close ( ) throws IOException { if ( ! writer . isClosed ( ) ) { int currentPositionInSegment = getCurrentPositionInSegment ( ) ; // write last segment writer . writeBlock ( getCurrentSegment ( ) ) ; clear ( ) ; writer . getReturnQueue ( ) . clear ( ) ; this . writer . close ( ) ; return currentPositionInSegment ; } return - 1 ; }
Closes this OutputView closing the underlying writer . And return number bytes in last memory segment .