Class LogOutputStream

java.lang.Object
java.io.OutputStream
com.sun.jini.reliableLog.LogOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class LogOutputStream extends OutputStream
This class extends the functionality of the java.io.OutputStream class in order to provide an output mechanism that can be used by processes that perform logging operations; in particular, processes that store state in order to provide persistence.
Author:
Sun Microsystems, Inc.
See Also:
  • Constructor Details

    • LogOutputStream

      public LogOutputStream(RandomAccessFile raf) throws IOException
      Creates an output file with the specified RandomAccessFile
      Parameters:
      raf - the output file
      Throws:
      IOException - If an I/O error has occurred.
  • Method Details

    • write

      public void write(int b) throws IOException
      Writes a byte of data. This method will block until the byte is actually written.
      Specified by:
      write in class OutputStream
      Parameters:
      b - the byte to be written
      Throws:
      IOException - If an I/O error has occurred.
    • write

      public void write(byte[] b) throws IOException
      Writes an array of bytes. Will block until the bytes are actually written.
      Overrides:
      write in class OutputStream
      Parameters:
      b - the data to be written
      Throws:
      IOException - If an I/O error has occurred.
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Writes a sub-array of bytes.
      Overrides:
      write in class OutputStream
      Parameters:
      b - the data to be written
      off - the start offset in the data
      len - the number of bytes to write
      Throws:
      IOException - If an I/O error has occurred.
    • close

      public final void close() throws IOException
      A LogOutputStream cannot be closed, so this does nothing.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException - If an I/O error has occurred.