MemoryInputStream (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.io.util

## Class MemoryInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.cassandra.io.util.AbstractDataInput
    - - org.apache.cassandra.io.util.MemoryInputStream

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

      public class MemoryInputStream
      extends AbstractDataInput
      implements java.io.DataInput

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemoryInputStream(Memory mem)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `long` | `getPosition()`
    `long` | `getPositionLimit()`
    `protected long` | `length()`
    `int` | `read()`
    `void` | `readFully(byte[] buffer, int offset, int count)` Read bytes from this file into `buffer` starting at offset `offset`.
    `void` | `seek(long pos)`

    - ### Methods inherited from class org.apache.cassandra.io.util.AbstractDataInput

      `readBoolean, readByte, readChar, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes`

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

      `available, mark, markSupported, read, read, reset, skip`

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

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

    - ### Methods inherited from interface java.io.DataInput

      `readBoolean, readByte, readChar, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes`

- - ### Constructor Detail

    - #### MemoryInputStream

          public MemoryInputStream(Memory mem)

  - ### Method Detail

    - #### read

          public int read()
                   throws java.io.IOException

      Specified by:
        `read` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### readFully

          public void readFully(byte[] buffer,
                                int offset,
                                int count)
                         throws java.io.IOException

      Description copied from class: `AbstractDataInput`
      Read bytes from this file into `buffer` starting at offset `offset`. This method blocks until `count` number of bytes have been read.
      Specified by:
        `readFully` in interface `java.io.DataInput`
      Overrides:
        `readFully` in class `AbstractDataInput`
      Parameters:
        `buffer` - the buffer to read bytes into.
        `offset` - the initial position in `buffer` to store the bytes read from this file.
        `count` - the maximum number of bytes to store in `buffer`.
      Throws:
        `java.io.EOFException` - if the end of this file is detected.
        `java.io.IOException` - if this file is closed or another I/O error occurs.

    - #### seek

          public void seek(long pos)

      Specified by:
        `seek` in class `AbstractDataInput`

    - #### getPosition

          public long getPosition()

      Specified by:
        `getPosition` in class `AbstractDataInput`

    - #### getPositionLimit

          public long getPositionLimit()

      Specified by:
        `getPositionLimit` in class `AbstractDataInput`

    - #### length

          protected long length()

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `java.io.InputStream`

Copyright © 2018 The Apache Software Foundation