org.apache.mina.util

## Class ByteBufferInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.mina.util.ByteBufferInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class ByteBufferInputStream
      extends InputStream

  `InputStream` wrapper for `ByteBuffer`

  Currently this class is only used and available in MINA's codec module

  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteBufferInputStream(ByteBuffer buffer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `mark(int readlimit)`
    `boolean` | `markSupported()`
    `int` | `read()`
    `int` | `read(byte[] b, int off, int len)`
    `void` | `reset()`
    `long` | `skip(long n)`

    - ### Methods inherited from class java.io.InputStream

      `close, read`

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

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

- - ### Constructor Detail

    - #### ByteBufferInputStream

          public ByteBufferInputStream(ByteBuffer buffer)

      Parameters:
        `buffer` - a buffer to be wrapped

  - ### Method Detail

    - #### available

          public int available()

      Overrides:
        `available` in class `InputStream`
      See Also:
        `InputStream.available()`

    - #### mark

          public void mark(int readlimit)

      Overrides:
        `mark` in class `InputStream`
      See Also:
        `InputStream.mark(int)`

    - #### markSupported

          public boolean markSupported()

      Overrides:
        `markSupported` in class `InputStream`
      See Also:
        `InputStream.markSupported()`

    - #### read

          public int read()

      Specified by:
        `read` in class `InputStream`
      See Also:
        `InputStream.read()`

    - #### read

          public int read(byte[] b,
                 int off,
                 int len)

      Overrides:
        `read` in class `InputStream`
      See Also:
        `InputStream.read(byte[], int, int)`

    - #### reset

          public void reset()

      Overrides:
        `reset` in class `InputStream`
      See Also:
        `InputStream.reset()`

    - #### skip

          public long skip(long n)

      Overrides:
        `skip` in class `InputStream`
      Parameters:
        `n` - the number of bytes to skip (values bigger than `Integer.MAX_VALUE` push the reading head to the end).
      See Also:
        `InputStream.skip(long)`

Copyright © 2009–2013 Apache MINA Project. All rights reserved.