@Override public void close() throws IOException { if (wrt != null) { this.wrt.close(); } super.close(); }
@Override public void open(int taskNumber, int numTasks) throws IOException { super.open(taskNumber, numTasks); if (this.buffer == null) { this.buffer = new byte[this.bufferSize]; } if (this.targetArray == null) { this.targetArray = new byte[64]; } this.pos = 0; }
super.configure(config);
@Override public void configure(Configuration parameters) { super.configure(parameters);
@Override public void open(int taskNumber, int numTasks) throws IOException { super.open(taskNumber, numTasks); this.wrt = this.charsetName == null ? new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096)) : new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096), this.charsetName); }
@Override public void close() throws IOException { if (this.stream != null) { this.stream.write(this.buffer, 0, this.pos); } // close file stream super.close(); }