Java OutputStream Write Byte Array writeBytes(byte[] data, OutputStream stream)

Here you can find the source of writeBytes(byte[] data, OutputStream stream)

Description

Writing byte array to stream

License

Open Source License

Parameter

Parameter Description
data data
stream destination stream

Exception

Parameter Description
IOException an exception

Declaration

public static void writeBytes(byte[] data, OutputStream stream) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**/*from   w  w  w  . j av a2  s .  co m*/
     * Writing byte array to stream
     *
     * @param data   data
     * @param stream destination stream
     * @throws IOException
     */
    public static void writeBytes(byte[] data, OutputStream stream) throws IOException {
        stream.write(data);
    }

    /**
     * Writing byte array to stream
     *
     * @param data   data
     * @param stream destination stream
     * @throws IOException
     */
    public static void writeBytes(byte[] data, int offset, int len, OutputStream stream) throws IOException {
        stream.write(data, offset, len);
    }
}

Related

  1. writeBytes(byte[] data, OutputStream out)
  2. writeBytes(byte[] data, OutputStream out)
  3. writeBytes(int[] data, OutputStream out)
  4. writeBytes(OutputStream os, byte[] b)
  5. writeBytes(OutputStream os, byte[] b)
  6. writeBytes(OutputStream out, byte[] data)