de.esprit.appsuite.nio.binary

## Class CharBufferWrapper

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

- All Implemented Interfaces:
    BinaryDataStructure, SimpleLogSupport, Dumpable, Resettable

      public class CharBufferWrapper
      extends ByteBufferWrapper

  This wrapper is a `ByteBufferWrapper` that uses 2 bytes for a character representation.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharBufferWrapper(java.lang.String name, BinaryChannel binaryChannel)` Constructor for reading a single char.
    `CharBufferWrapper(java.lang.String name, BinaryChannel binaryChannel, int numberOfValues)` Constructor for reading a char[] or a String.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `char` | `getChar()`
    `char` | `getChar(int index)`
    `char[]` | `getCharArray()`
    `protected java.nio.CharBuffer` | `getCharBuffer()`
    `int` | `getSize()` Returns the capacity of the underlying buffer in bytes.
    `java.lang.String` | `getString()` Reads in a loop until '0' was found as a string terminator
    `void` | `reset()` Clears the internal cache and forces the data to be re-read again on the next access.

    - ### Methods inherited from class de.esprit.appsuite.nio.binary.ByteBufferWrapper

      `getBinaryChannel, getByteBuffer, getByteOrder, getCapacity, getData, getEndPosition, getJavaDataType, getName, getNumberOfValues, getPredecessor, getReadOffset, getStartPosition, read, setPredecessor, setReadOffset`

    - ### 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

    - #### CharBufferWrapper

          public CharBufferWrapper(java.lang.String name,
                           BinaryChannel binaryChannel)

      Constructor for reading a single char.

    - #### CharBufferWrapper

          public CharBufferWrapper(java.lang.String name,
                           BinaryChannel binaryChannel,
                           int numberOfValues)

      Constructor for reading a char[] or a String.

  - ### Method Detail

    - #### getCharBuffer

          protected final java.nio.CharBuffer getCharBuffer()
                                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getChar

          public final char getChar()
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getChar

          public final char getChar(int index)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getCharArray

          public final char[] getCharArray()
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getString

          public final java.lang.String getString()
                                           throws java.io.IOException

      Reads in a loop until '0' was found as a string terminator
      Throws:
        `java.io.IOException`

    - #### getSize

          public final int getSize()
                            throws java.io.IOException

      Description copied from class: `ByteBufferWrapper`
      Returns the capacity of the underlying buffer in bytes.
      Overrides:
        `getSize` in class `ByteBufferWrapper`
      Throws:
        `java.io.IOException`

    - #### reset

          public void reset()

      Description copied from class: `ByteBufferWrapper`
      Clears the internal cache and forces the data to be re-read again on the next access.
      Specified by:
        `reset` in interface `Resettable`
      Overrides:
        `reset` in class `ByteBufferWrapper`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.