Interface EntryWriter

All Superinterfaces:
AutoCloseable, Closeable, Flushable
All Known Implementing Classes:
ConnectionEntryWriter, LdifEntryWriter

public interface EntryWriter extends Closeable, Flushable
An interface for writing entries to a data source, typically an LDIF file.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this entry writer, flushing it first.
    void
    Flushes this entry writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is also Flushable.
    Writes a comment.
    Writes an entry.
  • Method Details

    • close

      void close() throws IOException
      Closes this entry writer, flushing it first. Closing a previously closed entry writer has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - If an unexpected IO error occurred while closing.
    • flush

      void flush() throws IOException
      Flushes this entry writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is also Flushable.

      If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

      Specified by:
      flush in interface Flushable
      Throws:
      IOException - If an unexpected IO error occurred while flushing.
    • writeComment

      EntryWriter writeComment(CharSequence comment) throws IOException
      Writes a comment.
      Parameters:
      comment - The CharSequence to be written as a comment.
      Returns:
      A reference to this entry writer.
      Throws:
      IOException - If an unexpected IO error occurred while writing the comment.
      NullPointerException - If comment was null.
    • writeEntry

      EntryWriter writeEntry(Entry entry) throws IOException
      Writes an entry.
      Parameters:
      entry - The Entry to be written.
      Returns:
      A reference to this entry writer.
      Throws:
      IOException - If an unexpected IO error occurred while writing the entry.
      NullPointerException - If entry was null.