com.thinkaurelius.titan.diskstorage.util

## Class ReadArrayBuffer

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.util.StaticArrayBuffer
  - - com.thinkaurelius.titan.diskstorage.util.ReadArrayBuffer

- All Implemented Interfaces:
    ReadBuffer, ScanBuffer, StaticBuffer, Comparable<StaticBuffer>

      public class ReadArrayBuffer
      extends StaticArrayBuffer
      implements ReadBuffer

  Implementation of `ReadBuffer` against a byte array. Note, that the position does not impact the state of the object. Meaning, equals, hashcode, and compare ignore the position.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.thinkaurelius.titan.diskstorage.StaticBuffer

      `StaticBuffer.Factory<T>`

  - ### Field Summary

    - ### Fields inherited from class com.thinkaurelius.titan.diskstorage.util.StaticArrayBuffer

      `BYTE_LEN, CHAR_LEN, DOUBLE_LEN, FLOAT_LEN, INT_LEN, LONG_LEN, SHORT_LEN`

    - ### Fields inherited from interface com.thinkaurelius.titan.diskstorage.StaticBuffer

      `ARRAY_FACTORY, BB_FACTORY, STATIC_FACTORY`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `ReadArrayBuffer(byte[] array)`
    `protected` | `ReadArrayBuffer(byte[] array, int offset, int limit)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `asRelative(StaticBuffer.Factory<T> factory)`
    `boolean` | `getBoolean()`
    `byte` | `getByte()`
    `byte[]` | `getBytes(int length)`
    `char` | `getChar()`
    `char[]` | `getChars(int length)`
    `double` | `getDouble()`
    `double[]` | `getDoubles(int length)`
    `float` | `getFloat()`
    `float[]` | `getFloats(int length)`
    `int` | `getInt()`
    `int[]` | `getInts(int length)`
    `long` | `getLong()`
    `long[]` | `getLongs(int length)`
    `int` | `getPosition()`
    `short` | `getShort()`
    `short[]` | `getShorts(int length)`
    `boolean` | `hasRemaining()`
    `void` | `movePositionTo(int newPosition)`
    `ReadBuffer` | `subrange(int length, boolean invert)`

    - ### Methods inherited from class com.thinkaurelius.titan.diskstorage.util.StaticArrayBuffer

      `as, as, asByteBuffer, asReadBuffer, compareTo, compareTo, compareTo, compareTo, equals, getBoolean, getByte, getBytes, getChar, getChars, getDouble, getDoubles, getFloat, getFloats, getInt, getInt, getInts, getLong, getLong, getLongs, getShort, getShorts, hashCode, hashCode, length, of, of, putInt, putLong, subrange, subrange, toString, toString`

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

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

    - ### Methods inherited from interface com.thinkaurelius.titan.diskstorage.StaticBuffer

      `as, asByteBuffer, asReadBuffer, getBoolean, getByte, getBytes, getChar, getChars, getDouble, getDoubles, getFloat, getFloats, getInt, getInts, getLong, getLongs, getShort, getShorts, length, subrange, subrange`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Constructor Detail

    - #### ReadArrayBuffer

          public ReadArrayBuffer(byte[] array)

    - #### ReadArrayBuffer

          protected ReadArrayBuffer(byte[] array,
                         int offset,
                         int limit)

  - ### Method Detail

    - #### getPosition

          public int getPosition()

      Specified by:
        `getPosition` in interface `ReadBuffer`

    - #### hasRemaining

          public boolean hasRemaining()

      Specified by:
        `hasRemaining` in interface `ScanBuffer`

    - #### movePositionTo

          public void movePositionTo(int newPosition)

      Specified by:
        `movePositionTo` in interface `ReadBuffer`

    - #### getByte

          public byte getByte()

      Specified by:
        `getByte` in interface `ScanBuffer`

    - #### getBoolean

          public boolean getBoolean()

      Specified by:
        `getBoolean` in interface `ScanBuffer`

    - #### getShort

          public short getShort()

      Specified by:
        `getShort` in interface `ScanBuffer`

    - #### getInt

          public int getInt()

      Specified by:
        `getInt` in interface `ScanBuffer`

    - #### getLong

          public long getLong()

      Specified by:
        `getLong` in interface `ScanBuffer`

    - #### getChar

          public char getChar()

      Specified by:
        `getChar` in interface `ScanBuffer`

    - #### getFloat

          public float getFloat()

      Specified by:
        `getFloat` in interface `ScanBuffer`

    - #### getDouble

          public double getDouble()

      Specified by:
        `getDouble` in interface `ScanBuffer`

    - #### getBytes

          public byte[] getBytes(int length)

      Specified by:
        `getBytes` in interface `ScanBuffer`

    - #### getShorts

          public short[] getShorts(int length)

      Specified by:
        `getShorts` in interface `ScanBuffer`

    - #### getInts

          public int[] getInts(int length)

      Specified by:
        `getInts` in interface `ScanBuffer`

    - #### getLongs

          public long[] getLongs(int length)

      Specified by:
        `getLongs` in interface `ScanBuffer`

    - #### getChars

          public char[] getChars(int length)

      Specified by:
        `getChars` in interface `ScanBuffer`

    - #### getFloats

          public float[] getFloats(int length)

      Specified by:
        `getFloats` in interface `ScanBuffer`

    - #### getDoubles

          public double[] getDoubles(int length)

      Specified by:
        `getDoubles` in interface `ScanBuffer`

    - #### asRelative

          public <T> T asRelative(StaticBuffer.Factory<T> factory)

      Specified by:
        `asRelative` in interface `ReadBuffer`

    - #### subrange

          public ReadBuffer subrange(int length,
                            boolean invert)

      Specified by:
        `subrange` in interface `ReadBuffer`

Copyright © 2012–2014. All rights reserved.