转换为{@link BufferedOutputStream}

@param out {@link OutputStream}
@return {@link BufferedOutputStream}
@since 4.0.10
484399
public static BufferedOutputStream toBuffered(OutputStream out) {
		return (out instanceof BufferedOutputStream) ? (BufferedOutputStream) out : new BufferedOutputStream(out);
	}
1306059
@Override
	protected void serializeTo(RawDataBuffer out)
    {
        super.serializeTo(out);
    	out.writeByteArray(SerializationTools.toByteArray(error));
    }
1038509
public void writeToOutputStream(OutputStream os) throws IOException {
		if(sb == null) {
			throw new IllegalStateException("No interal StringBuffer");
		}
		byte[] b;
		try {
			b = getBytes();
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
		os.write(b);
	}
259589
public void derEncode(OutputStream out) throws IOException {
        DerOutputStream         tmp = new DerOutputStream();
        DerOutputStream         tmp2 = new DerOutputStream();

        tmp.putOID(oid);
        value.encode(tmp);
        tmp2.write(DerValue.tag_Sequence, tmp);
        out.write(tmp2.toByteArray());
    }
128137
public BufferedInputStream asBufferedInputStream() {
        InputStream is = asInputStream();
        if (is == null) return null;
        if (is instanceof BufferedInputStream) return (BufferedInputStream) is;
        return new BufferedInputStream(is);
    }
417524
public static int pipeBytes(InputStream in, OutputStream out, byte[] buffer) throws IOException {
		int count = 0;
		int length;

		while ((length = (in.read(buffer))) >= 0) {
			out.write(buffer, 0, length);
			count += length;
		}
		return count;
	}
120228
@Override
    public OutputStream getOutputStream() throws IOException {

	URLConnection connection = url.openConnection();
	if (connection == null) return null;

	connection.setDoOutput(true); // is it necessary?
	return connection.getOutputStream();
    }
707136
public static void writeStreamToStream(InputStream input, OutputStream output)
  throws IOException {
    byte[] buffer = new byte[4096];
    while (true) {
      int len = input.read(buffer);
      if (len == -1) {
        break;
      }
      output.write(buffer, 0, len);
    }
  }
861232
public OutputStream createOutOutputStream(OutputStream os) {
        return new InstrumentedOutputStream(collector(), Direction.Out, os, null);
    }
408312
public boolean outputStreamObtained() {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"outputStreamObtained"," " + String.valueOf(_gotOutputStream),"["+this+"]");
        return _gotOutputStream;
    }
297943
public static void writeGzipObjectToStream(final Object o, OutputStream out) {
    out = new BufferedOutputStream(out);
    try {
      out = new GZIPOutputStream(out, true);
      final ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(o);
      oos.flush();
    } catch (final IOException e) {
      e.printStackTrace();
    }
  }
844862
public boolean readToOutputStream(OutputStream os)
        throws IOException
    {
        InputStream is = readInputStream();

        if (is == null)
            return false;

        if (_buffer == null)
            _buffer = new byte[256];

        try {
            int len;

            while ((len = is.read(_buffer, 0, _buffer.length)) > 0) {
                os.write(_buffer, 0, len);
            }

            return true;
        } finally {
            is.close();
        }
    }
702292
@Override
    public void dump(OutputStream output) {
        try (PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8))) {
            for (long value : values) {
                out.printf("%d%n", value);
            }
        }
    }
1313233
public static void transferStream(InputStream in, OutputStream out)
   {
       try {
    	   byte[] cbuf = new byte[1000];
           int iLen = 0;
           while ((iLen = in.read(cbuf, 0, cbuf.length)) > 0)
           {   // Write the entire file to the output buffer
               out.write(cbuf, 0, iLen);
           }
           in.close();
       } catch (MalformedURLException ex)  {
           ex.printStackTrace();
       } catch (IOException ex) {
           ex.printStackTrace();
       }
   }
162574
public ServletOutputStream getOutputStream() throws IOException {
        return new ServletOutputStream() {
            protected OutputStream proxy;
            public void write(int b) throws IOException {
                if (proxy == null)
                    proxy = getResponse().getOutputStream();
                proxy.write(b);
            }
            
            public void write(byte[] paramArrayOfByte, int off, int len)
                    throws IOException {
                if (proxy == null)
                    proxy = getResponse().getOutputStream();
                proxy.write(paramArrayOfByte, off, len);
            }
        };
    }
835768
public void dumpTo(OutputStream out)
    {
        PrintWriter writer;
        try {
            writer = new PrintWriter(new OutputStreamWriter(out, "utf-8"));
        } catch (UnsupportedEncodingException e) {
            writer = new PrintWriter(out);
        }
        recursiveDump(root, 0, writer);
        writer.close();
    }
540686
private static ZipOutputStream getZipOutputStream(OutputStream out, Charset charset) {
		charset = (null == charset) ? DEFAULT_CHARSET : charset;
		return new ZipOutputStream(out, charset);
	}