Write the data to column if the configured chunk size is reached or if the
stream should be closed

@param close
@throws IOException
970570
private void writeData(boolean close) throws IOException {
    if (pos != 0 && (close || pos == chunk.length - 1)) {
      byte[] data;
      if (pos != chunk.length - 1) {
        data = new byte[(int) pos + 1];
        // we need to adjust the array
        System.arraycopy(chunk, 0, data, 0, data.length);
      } else {
        data = chunk;
      }
      try {
        mutator.insert(key, cf, HFactory.createColumn(chunkPos, data, LongSerializer.get(), BytesArraySerializer.get()));
      } catch (HectorException e) {
        throw new IOException("Unable to write data", e);
      }
      chunkPos++;
      pos = 0;
    }

  }
706001
@Override
    public void write(byte[] b, int off, int len) throws IOException {
        if (currentEntry != null && !currentEntry.isDirectory()) {
            if (currentEntry.getSize() < currentFileSize + len) {
                throw new IOException( "The current entry[" + currentEntry.getName() + "] size["
                        + currentEntry.getSize() + "] is smaller than the bytes[" + ( currentFileSize + len )
                        + "] being written." );
            }
        }

        out.write( b, off, len );
        
        bytesWritten += len;

        if (currentEntry != null) {
            currentFileSize += len;
        }        
    }
474586
public void close() throws IOException {
        if (!closed) {
            this.finish();
            this.buffer.close();
            out.close();
            closed = true;
        }
    }
804078
@Override
	public void writeRecord(OUT tuple) throws IOException {
		try {
			if (query.split("\\?,").length != tuple.getArity()) {
				close();
				throw new IOException("Tuple size does not match columncount");
			}
			if (types == null) {
				extractTypes(tuple);
			}
			addValues(tuple);
			upload.addBatch();
			batchCount++;
			if (batchCount >= batchInterval) {
				upload.executeBatch();
				batchCount = 0;
			}
		} catch (SQLException sqe) {
			close();
			throw new IllegalArgumentException("writeRecord() failed", sqe);
		} catch (IllegalArgumentException iae) {
			close();
			throw new IllegalArgumentException("writeRecord() failed", iae);
		}
	}
692157
public void writeTo(DataOutputPlus output) throws IOException
    {
        ByteBufferUtil.writeWithShortLength(column, output);
        operator.writeTo(output);
        ByteBufferUtil.writeWithShortLength(value, output);
    }
6602
protected void writeRow(final String... columns) throws IOException {
		
		if( columns == null ) {
			throw new NullPointerException(String.format("columns to write should not be null on line %d", lineNumber));
		} else if( columns.length == 0 ) {
			throw new IllegalArgumentException(String.format("columns to write should not be empty on line %d",
				lineNumber));
		}
		
		StringBuilder builder = new StringBuilder();
		for( int i = 0; i < columns.length; i++ ) {
			
			columnNumber = i + 1; // column no used by CsvEncoder
			
			if( i > 0 ) {
				builder.append((char) preference.getDelimiterChar()); // delimiter
			}
			
			final String csvElement = columns[i];
			if( csvElement != null ) {
				final CsvContext context = new CsvContext(lineNumber, rowNumber, columnNumber);
				final String escapedCsv = encoder.encode(csvElement, context, preference);
				builder.append(escapedCsv);
				lineNumber = context.getLineNumber(); // line number can increment when encoding multi-line columns
			}
			
		}
		
		builder.append(preference.getEndOfLineSymbols()); // EOL
		writer.write(builder.toString());
	}
444109
@Override
    public void write(int b) throws IOException {
        out.write( b );
        bytesWritten += 1;

        if (currentEntry != null) {
            currentFileSize += 1;
        }
    }
546020
public void writeClose(Writer writer) throws IOException {
		writer.append(CLOSEBRACE).append(CLOSEPARENTHESIS).append(PARENTHESIS).append(SEMICOLON).append(CR); // })();
	}
994863
public void write(DataOutput out) throws IOException {
    out.writeLong(blockId);
    out.writeLong(blockGenStamp);
    super.write(out);
  }
877967
public void close() throws IOException
  {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      {
        Tr.debug(tc, "close");
      }
      closed = true;
      this.output.close();
  }
293331
@Override
	public void close() throws IOException {
		try {
			upload.executeBatch();
			batchCount = 0;
		} catch (SQLException se) {
			throw new IllegalArgumentException("close() failed", se);
		} catch (NullPointerException se) {
		}
		try {
			upload.close();
		} catch (SQLException se) {
			LOG.info("Inputformat couldn't be closed - " + se.getMessage());
		} catch (NullPointerException npe) {
		}
		try {
			dbConn.close();
		} catch (SQLException se) {
			LOG.info("Inputformat couldn't be closed - " + se.getMessage());
		} catch (NullPointerException npe) {
		}
	}
984275
public void close() throws IOException {
        if(buffer.size() > 0) {
            buffer.get( buffer.size()-1 ).setIsEOS();
        } else {
            OggPacket p = new OggPacket(new byte[0]);
            p.setIsEOS();
            bufferPacket(p);
        }
        flush();

        closed = true;
    }
570991
@Override
  public void close() throws IOException
  {
      if(this.in != null && this.inStream != null){
          if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
              logger.logp(Level.FINE, CLASS_NAME,"close", "close called->"+this);
          }
          this.in.close();
      }
      else{
          super.close();
      }
  }
1145934
@Override
    public void close() throws IOException {
        try {
            if (reference != null) {
                closer.close(reference);
            }
        } catch (Exception e) {
            throw new IOException(e);
        } finally {
            this.wasClosed = true;
        }
    }
876407
protected void store(BufferedWriter out, String type, byte[] data) throws IOException
    {
        write(out, type, data);
        out.close();
    }
761354
private void closeDataReader() throws IOException {
    if (mCurrentChunk != null) {
      mCurrentChunk.release();
      mCurrentChunk = null;
    }
    if (mDataReader != null) {
      mDataReader.close();
    }
    mDataReader = null;
  }
785830
@Override
    public void close() throws IOException
    {
        if (!_closed) {
            _closed = true;
            _nodeCursor = null;
            _currToken = null;
        }
    }