Java Dump Stream dumpEvent(String event, OutputStream stream)

Here you can find the source of dumpEvent(String event, OutputStream stream)

Description

dump an array of bytes to an OutputStream

License

Open Source License

Parameter

Parameter Description
data the byte array to be dumped
offset its offset, whatever that might mean
stream the OutputStream to which the data is to be written
index initial index into the byte array

Declaration

public static void dumpEvent(String event, OutputStream stream) throws IOException 

Method Source Code


//package com.java2s;
/* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under 
 * the Apache 2.0 License, see http://coconut.codehaus.org/license.
 *///  w  w  w  .  ja va2  s. c o  m

import java.io.IOException;
import java.io.OutputStream;

public class Main {
    private static final String EOL = System.getProperty("line.separator");

    /**
     * dump an array of bytes to an OutputStream
     *
     * @param data the byte array to be dumped
     * @param offset its offset, whatever that might mean
     * @param stream the OutputStream to which the data is to be
     *               written
     * @param index initial index into the byte array
     *
     * @exception IOException is thrown if anything goes wrong writing
     *            the data to stream
     * @exception ArrayIndexOutOfBoundsException if the index is
     *            outside the data array's bounds
     * @exception IllegalArgumentException if the output stream is
     *            null
     */
    public static void dumpEvent(String event, OutputStream stream) throws IOException {
        stream.write(event.getBytes());
        stream.write(EOL.getBytes());
    }
}

Related

  1. dump(InputStream inputStream, OutputStream out)
  2. dump(InputStream is, File to)
  3. dump(PrintStream p, String indent, String s)
  4. dumparr(Object[] arr, PrintStream out, boolean term)
  5. dumpArray(PrintStream out, Object[] array)
  6. dumpFile(InputStream file, String header, String testName)
  7. dumpFile(JarInputStream jin, File targetFile)
  8. dumpFile(String r_file, OutputStream outputstream)
  9. dumpInputOutputStream(InputStream is, OutputStream os)