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

### Constructor Summary

Constructors
Constructor and Description
`MemoryInputStream(Memory mem)`

### Method Summary

Methods
`void` `close()`
`protected int` `getPosition()`
`int` `read()`
`void` `readFully(byte[] buffer, int offset, int count)` Read bytes from this file into `buffer` starting at offset `offset`.
`protected void` `seekInternal(int pos)`
`int` `skipBytes(int n)`

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

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

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

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

#### seekInternal

    protected void seekInternal(int pos)

Specified by:
  `seekInternal` in class `AbstractDataInput`

#### getPosition

    protected int getPosition()

Specified by:
  `getPosition` in class `AbstractDataInput`

#### skipBytes

    public int skipBytes(int n)
                  throws java.io.IOException

Throws:
  `java.io.IOException`

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