de.esprit.appsuite.nio.binary

## Class BinaryDataWriter

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.log.SimpleLogSupportAdapter
    - - de.esprit.appsuite.nio.binary.BinaryDataWriter

- All Implemented Interfaces:
    SimpleLogSupport, Dumpable, java.io.Closeable, java.lang.AutoCloseable

      public class BinaryDataWriter
      extends SimpleLogSupportAdapter
      implements java.io.Closeable

  This writer is used to write binary data structures into a file.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BinaryDataWriter(AsyncExecutable executor, java.io.File file)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `java.io.File` | `getFile()`
    `long` | `getFileSize()`
    `void` | `openOutput()`
    `long` | `setPosition(long newPosition)`
    `long` | `write(AbstractByteBufferStore store)` Write content of all registered `AbstractByteBufferStore`s starting at startPosition.
    `long` | `write(AbstractByteBufferStore store, long startPosition)` Write content of all registered `AbstractByteBufferStore`s starting at startPosition.
    `long` | `write(java.nio.ByteBuffer bb)`
    `long` | `write(java.nio.ByteBuffer bb, long position)`

    - ### Methods inherited from class de.esprit.common.log.SimpleLogSupportAdapter

      `getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BinaryDataWriter

          public BinaryDataWriter(AsyncExecutable executor,
                          java.io.File file)

  - ### Method Detail

    - #### getFile

          public final java.io.File getFile()

    - #### getFileSize

          public final long getFileSize()
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### openOutput

          public void openOutput()
                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### setPosition

          public long setPosition(long newPosition)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public final long write(java.nio.ByteBuffer bb)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public final long write(java.nio.ByteBuffer bb,
                   long position)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### close

          public final void close()
                           throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `java.io.IOException`

    - #### write

          public final long write(AbstractByteBufferStore store)
                           throws java.io.IOException

      Write content of all registered `AbstractByteBufferStore`s starting at startPosition.
      Throws:
        `java.io.IOException`

    - #### write

          public final long write(AbstractByteBufferStore store,
                   long startPosition)
                           throws java.io.IOException

      Write content of all registered `AbstractByteBufferStore`s starting at startPosition.
      Throws:
        `java.io.IOException`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.