org.apache.ignite.internal.util.io

## Class GridUnsafeDataInput

- java.lang.Object
- - java.io.InputStream
  - - org.apache.ignite.internal.util.io.GridUnsafeDataInput

All Implemented Interfaces:
  Closeable, DataInput, AutoCloseable, GridDataInput

    public class GridUnsafeDataInput
    extends InputStream
    implements GridDataInput

Data input based on `Unsafe` operations.

### Constructor Summary

Constructors
Constructor and Description
`GridUnsafeDataInput()`

### Method Summary

Methods
`void` `bytes(byte[] bytes, int len)`
`void` `bytes(byte[] bytes, int off, int len)`
`void` `inputStream(InputStream in)`
`int` `read()`
`int` `read(byte[] b, int off, int len)`
`boolean` `readBoolean()`
`boolean[]` `readBooleanArray()` Reads array of `boolean`s.
`byte` `readByte()`
`byte[]` `readByteArray()` Reads array of `byte`s.
`char` `readChar()`
`char[]` `readCharArray()` Reads array of `char`s.
`double` `readDouble()`
`double[]` `readDoubleArray()` Reads array of `double`s.
`float` `readFloat()`
`float[]` `readFloatArray()` Reads array of `float`s.
`void` `readFully(byte[] b)`
`void` `readFully(byte[] b, int off, int len)`
`int` `readInt()`
`int[]` `readIntArray()` Reads array of `int`s.
`String` `readLine()`
`long` `readLong()`
`long[]` `readLongArray()` Reads array of `long`s.
`short` `readShort()`
`short[]` `readShortArray()` Reads array of `short`s.
`int` `readUnsignedByte()`
`int` `readUnsignedShort()`
`String` `readUTF()`
`void` `reset()` Resets data output.
`int` `skipBytes(int n)`
`String` `toString()`

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

`available, close, mark, markSupported, read, skip`

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

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

### Methods inherited from interface org.apache.ignite.internal.util.io.GridDataInput

`read`

### Constructor Detail

#### GridUnsafeDataInput

    public GridUnsafeDataInput()

### Method Detail

#### bytes

    public void bytes(byte[] bytes,
             int len)

Specified by:
  `bytes` in interface `GridDataInput`
Parameters:
  `bytes` - Bytes.
  `len` - Length.

#### bytes

    public void bytes(byte[] bytes,
             int off,
             int len)

Parameters:
  `bytes` - Bytes.
  `off` - Offset.
  `len` - Length.

#### inputStream

    public void inputStream(InputStream in)
                     throws IOException

Specified by:
  `inputStream` in interface `GridDataInput`
Parameters:
  `in` - Underlying input stream.
Throws:
  `IOException` - In case of error.

#### reset

    public void reset()
               throws IOException

Resets data output.

Specified by:
  `reset` in interface `GridDataInput`
Overrides:
  `reset` in class `InputStream`
Throws:
  `IOException` - In case of error.

#### readByteArray

    public byte[] readByteArray()
                         throws IOException

Reads array of `byte`s.

Specified by:
  `readByteArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readShortArray

    public short[] readShortArray()
                           throws IOException

Reads array of `short`s.

Specified by:
  `readShortArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readIntArray

    public int[] readIntArray()
                       throws IOException

Reads array of `int`s.

Specified by:
  `readIntArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readDoubleArray

    public double[] readDoubleArray()
                             throws IOException

Reads array of `double`s.

Specified by:
  `readDoubleArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readBooleanArray

    public boolean[] readBooleanArray()
                               throws IOException

Reads array of `boolean`s.

Specified by:
  `readBooleanArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readCharArray

    public char[] readCharArray()
                         throws IOException

Reads array of `char`s.

Specified by:
  `readCharArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readLongArray

    public long[] readLongArray()
                         throws IOException

Reads array of `long`s.

Specified by:
  `readLongArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readFloatArray

    public float[] readFloatArray()
                           throws IOException

Reads array of `float`s.

Specified by:
  `readFloatArray` in interface `GridDataInput`
Returns:
  Array.
Throws:
  `IOException` - In case of error.

#### readFully

    public void readFully(byte[] b)
                   throws IOException

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

#### readFully

    public void readFully(byte[] b,
                 int off,
                 int len)
                   throws IOException

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

#### skipBytes

    public int skipBytes(int n)
                  throws IOException

Specified by:
  `skipBytes` in interface `DataInput`
Throws:
  `IOException`

#### readBoolean

    public boolean readBoolean()
                        throws IOException

Specified by:
  `readBoolean` in interface `DataInput`
Throws:
  `IOException`

#### readByte

    public byte readByte()
                  throws IOException

Specified by:
  `readByte` in interface `DataInput`
Throws:
  `IOException`

#### readUnsignedByte

    public int readUnsignedByte()
                         throws IOException

Specified by:
  `readUnsignedByte` in interface `DataInput`
Throws:
  `IOException`

#### readShort

    public short readShort()
                    throws IOException

Specified by:
  `readShort` in interface `DataInput`
Throws:
  `IOException`

#### readUnsignedShort

    public int readUnsignedShort()
                          throws IOException

Specified by:
  `readUnsignedShort` in interface `DataInput`
Throws:
  `IOException`

#### readChar

    public char readChar()
                  throws IOException

Specified by:
  `readChar` in interface `DataInput`
Throws:
  `IOException`

#### readInt

    public int readInt()
                throws IOException

Specified by:
  `readInt` in interface `DataInput`
Throws:
  `IOException`

#### readLong

    public long readLong()
                  throws IOException

Specified by:
  `readLong` in interface `DataInput`
Throws:
  `IOException`

#### readFloat

    public float readFloat()
                    throws IOException

Specified by:
  `readFloat` in interface `DataInput`
Throws:
  `IOException`

#### readDouble

    public double readDouble()
                      throws IOException

Specified by:
  `readDouble` in interface `DataInput`
Throws:
  `IOException`

#### read

    public int read()
             throws IOException

Specified by:
  `read` in interface `GridDataInput`
Specified by:
  `read` in class `InputStream`
Returns:
  The next byte of data, or `-1` if the end of the stream is reached.
Throws:
  `IOException` - In case of error.

#### read

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

Specified by:
  `read` in interface `GridDataInput`
Overrides:
  `read` in class `InputStream`
Parameters:
  `b` - Buffer into which the data is read.
  `off` - Start offset.
  `len` - Maximum number of bytes to read.
Returns:
  Total number of bytes read into the buffer, or `-1` is there is no more data because the end of the stream has been reached.
Throws:
  `IOException` - In case of error.

#### readLine

    public String readLine()
                    throws IOException

Specified by:
  `readLine` in interface `DataInput`
Throws:
  `IOException`

#### readUTF

    public String readUTF()
                   throws IOException

Specified by:
  `readUTF` in interface `DataInput`
Throws:
  `IOException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015