Writes the parameter to an outputstream.

@param os the outputstream to write to
@throws java.io.IOException if we cannot write to the stream
190963
public final int writeTo(final OutputStream os,int offset, int maxWriteSize) throws IOException {
        int bytesToWrite = Math.min(blobReference.getBytes().length - offset, maxWriteSize);
        os.write(blobReference.getBytes(), offset, blobReference.getBytes().length);
        return bytesToWrite;
    }
338795
public static <E> void serialize(List<E> list, OutputStream os, Class<E> jsonObjectClass) throws IOException {
        mapperFor(jsonObjectClass).serialize(list, os);
    }
352231
public void write(Bean bean, OutputStream output) throws IOException {
        write(bean, true, output);
    }
525509
public void write(OutputStream out, int offset,
                    int length) throws IOException {
    data.getBytes(offset, out, length);
  }
1155075
public void sendfile(OutputStream os, long offset, long length)
    throws IOException
  {
    if (os instanceof OutputStreamWithBuffer) {
      writeToStream((OutputStreamWithBuffer) os);
    }
    else {
      writeToStream(os);
    }
  }
443499
public void writeTo(final OutputStream out) throws IOException
	{
		if(out == null) throw new NullPointerException();
		
		final int n = arrays.size();
		for(int k = 0; k < n; k++) {
			byte[] src = (byte[])arrays.get(k);
			out.write(src);
		}
		if(pos > 0) out.write(buffer, 0, pos);
	}
935247
public void write(Object object, OutputStream os, MediaType mediaType)
            throws IOException {
        XStream xstream = getXStreamInstance(mediaType);
        if (xstream != null) {
            xstream.toXML(object, os);
        } else {
            throw new IllegalArgumentException("Content-type: "
                    + mediaType.getType() + " is currently not supported for "
                    + object.getClass().getName());
        }
    }
1184148
private void setProcessInputStream(OutputStream os) {
        if (input != null) {
            inputThread = createPump(input, os, true);
        } else {
            AntFileUtils.close(os);
        }
    }
548514
public void write(BitOutputStream os) throws IOException {

        os.writeRawULong(sampleNumber, SEEKPOINT_SAMPLE_NUMBER_LEN);
        os.writeRawULong(streamOffset, SEEKPOINT_STREAM_OFFSET_LEN);
        os.writeRawUInt(frameSamples, SEEKPOINT_FRAME_SAMPLES_LEN);
    }
472805
public void write(byte []buf, int offset, int length, boolean isEnd)
    throws IOException
  {
    OutputStream os = _os;
    
    if (os != null) {
      os.write(buf, offset, length);
    }
  }
1297531
public void write(OutputStream os)
	{
		List<String> ids = new ArrayList<String>(score.keySet());
		final Map<String, Integer> score = this.score;
		Collections.sort(ids, new Comparator<String>()
		{
			@Override
			public int compare(String o1, String o2)
			{
				return score.get(o2).compareTo(score.get(o1));
			}
		});

		try
		{
			BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os));

			boolean notFirst = false;

			for (String id : ids)
			{
				if (notFirst) writer.write("\n");
				else notFirst = true;

				writer.write(id + DELIM + score.get(id) + DELIM + convertContext(context.get(id)));
			}

			writer.close();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}
59198
public void writeToStream(OutputStream stream, Object object) throws SerializationException {
        try {
            mapper.writeValue(stream, object);
        } catch (IOException ex) {
            throw new SerializationException("Exception during serialization", ex);
        }
    }
848068
public static void copy(InputStream is, OutputStream os) throws IOException {

		Asserts.notNullParameter("is", is);
		Asserts.notNullParameter("os", os);
		
		try {
			byte[] buf = new byte[1024];
			int len = 0;
			
			while((len = is.read(buf)) > 0) {
				os.write(buf, 0, len);
			}
		
		} finally {
			if(os != null) {
				try {
					os.close();
				} catch (IOException e) {
					// ignore
				}
			}
			if(is != null) {
				try {
					is.close();
				} catch (IOException e) {
					// ignore
				}
			}
		}
	}
428204
@Override
  public void write(byte[] buffer, int offset, int length)
  {
    try {
      OutputStream os = _os;

      if (os != null) {
        os.write(buffer, offset, length);
      }
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);
    }
  }
639739
public int write(OutputStreamWithBuffer os, char []cbuf, int off, int len)
    throws IOException
  {
    for (int i = 0; i < len; i++) {
      write(os, cbuf[off + i]);
    }
    
    return len;
  }
10489
@Override
	public void write(final OutputStream output) throws IOException
	{
		initialize();
		if (content == null)
		{
			content = new byte[0];
		}
		output.write(content, 0, content.length);
		output.flush();
	}
386167
public void writeToStream(OutputStream os, int len)
    throws IOException
  {
    while (len > 0) {
      if (_readLength <= _readOffset) {
        if (! readBuffer())
          return;
      }

      int sublen = Math.min(len, _readLength - _readOffset);

      os.write(_readBuffer, _readOffset, sublen);
      _readOffset += sublen;
      len -= sublen;
    }
  }