de.esprit.appsuite.nio.binary

## Class IntBufferWrapper

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

- All Implemented Interfaces:
    BinaryDataStructure, SimpleLogSupport, Dumpable, Resettable
  Direct Known Subclasses:
    Boolean32BufferWrapper, String32BufferWrapper

      public class IntBufferWrapper
      extends NumberBufferWrapper

  This buffer wrapper reads one or more int values. Note that fetching a value by index reads a single value only rather than loading the whole buffer.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IntBufferWrapper(java.lang.String name, BinaryChannel binaryChannel)`
    `IntBufferWrapper(java.lang.String name, BinaryChannel binaryChannel, int numberOfValues)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NumberBufferWrapper` | `createSingleValueBufferWrapper()`
    `double` | `getDoubleValue()`
    `double` | `getDoubleValue(int index)`
    `protected java.nio.IntBuffer` | `getIntBuffer()`
    `int` | `getValue()` Loads all values into the buffer and returns the first one.
    `int` | `getValue(int index)` Returns the value at the given index.
    `int[]` | `getValues()` Loads all values into the buffer and returns them as an array.
    `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.NumberBufferWrapper

      `getSingleValueBufferWrapper`

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

      `getBinaryChannel, getByteBuffer, getByteOrder, getCapacity, getData, getEndPosition, getJavaDataType, getName, getNumberOfValues, getPredecessor, getReadOffset, getSize, 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

    - #### IntBufferWrapper

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

    - #### IntBufferWrapper

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

  - ### Method Detail

    - #### getIntBuffer

          protected final java.nio.IntBuffer getIntBuffer()
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getValue

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

      Loads all values into the buffer and returns the first one. The value is cached internally until `reset()` is called.
      Throws:
        `java.io.IOException`

    - #### getValues

          public final int[] getValues()
                                throws java.io.IOException

      Loads all values into the buffer and returns them as an array. The array is cached internally until `reset()` is called.
      Throws:
        `java.io.IOException`

    - #### getValue

          public final int getValue(int index)
                             throws java.io.IOException

      Returns the value at the given index. Note that this method is tuned to load only a single value at the given index rather than loading the whole buffer. Thus fetching all values by index may be inefficient. Consider to use `getValues()` instead.
      Throws:
        `java.io.IOException`

    - #### getDoubleValue

          public double getDoubleValue()
                                throws java.io.IOException

      Specified by:
        `getDoubleValue` in class `NumberBufferWrapper`
      Throws:
        `java.io.IOException`

    - #### getDoubleValue

          public double getDoubleValue(int index)
                                throws java.io.IOException

      Specified by:
        `getDoubleValue` in class `NumberBufferWrapper`
      Throws:
        `java.io.IOException`

    - #### createSingleValueBufferWrapper

          protected NumberBufferWrapper createSingleValueBufferWrapper()

      Specified by:
        `createSingleValueBufferWrapper` in class `NumberBufferWrapper`

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

Copyright © 2014 EsprIT-Systems. All Rights Reserved.