org.apache.ignite.internal.util.io

## Class GridUnsafeDataOutput

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.ignite.internal.util.io.GridUnsafeDataOutput

All Implemented Interfaces:
  Closeable, DataOutput, Flushable, AutoCloseable, GridDataOutput

    public class GridUnsafeDataOutput
    extends OutputStream
    implements GridDataOutput

Data output based on `Unsafe` operations.

### Constructor Summary

Constructors
Constructor and Description
`GridUnsafeDataOutput()`
`GridUnsafeDataOutput(int size)`

### Method Summary

Methods
`byte[]` `array()`
`void` `bytes(byte[] bytes, int off)`
`void` `close()`
`byte[]` `internalArray()`
`int` `offset()`
`void` `offset(int off)`
`void` `outputStream(OutputStream out)`
`void` `reset()` Resets data output.
`String` `toString()`
`void` `write(byte[] b)`
`void` `write(byte[] b, int off, int len)`
`void` `write(int b)`
`void` `writeBoolean(boolean v)`
`void` `writeBooleanArray(boolean[] arr)` Writes array of `boolean`s.
`void` `writeByte(int v)`
`void` `writeByteArray(byte[] arr)` Writes array of `byte`s.
`void` `writeBytes(String s)`
`void` `writeChar(int v)`
`void` `writeCharArray(char[] arr)` Writes array of `char`s.
`void` `writeChars(String s)`
`void` `writeDouble(double v)`
`void` `writeDoubleArray(double[] arr)` Writes array of `double`s.
`void` `writeFloat(float v)`
`void` `writeFloatArray(float[] arr)` Writes array of `float`s.
`void` `writeInt(int v)`
`void` `writeIntArray(int[] arr)` Writes array of `int`s.
`void` `writeLong(long v)`
`void` `writeLongArray(long[] arr)` Writes array of `long`s.
`void` `writeShort(int v)`
`void` `writeShortArray(short[] arr)` Writes array of `short`s.
`void` `writeUTF(String s)`

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

`flush`

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

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

### Constructor Detail

#### GridUnsafeDataOutput

    public GridUnsafeDataOutput()

#### GridUnsafeDataOutput

    public GridUnsafeDataOutput(int size)

Parameters:
  `size` - Size

### Method Detail

#### bytes

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

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

#### outputStream

    public void outputStream(OutputStream out)

Specified by:
  `outputStream` in interface `GridDataOutput`
Parameters:
  `out` - Underlying output stream.

#### array

    public byte[] array()

Specified by:
  `array` in interface `GridDataOutput`
Returns:
  Copy of internal array shrunk to offset.

#### internalArray

    public byte[] internalArray()

Specified by:
  `internalArray` in interface `GridDataOutput`
Returns:
  Internal array.

#### offset

    public int offset()

Specified by:
  `offset` in interface `GridDataOutput`
Returns:
  Offset.

#### offset

    public void offset(int off)

Specified by:
  `offset` in interface `GridDataOutput`
Parameters:
  `off` - Offset.

#### write

    public void write(byte[] b)
               throws IOException

Specified by:
  `write` in interface `DataOutput`
Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

#### write

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

Specified by:
  `write` in interface `DataOutput`
Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

#### writeDoubleArray

    public void writeDoubleArray(double[] arr)
                          throws IOException

Writes array of `double`s.

Specified by:
  `writeDoubleArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeBooleanArray

    public void writeBooleanArray(boolean[] arr)
                           throws IOException

Writes array of `boolean`s.

Specified by:
  `writeBooleanArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeCharArray

    public void writeCharArray(char[] arr)
                        throws IOException

Writes array of `char`s.

Specified by:
  `writeCharArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeLongArray

    public void writeLongArray(long[] arr)
                        throws IOException

Writes array of `long`s.

Specified by:
  `writeLongArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeFloatArray

    public void writeFloatArray(float[] arr)
                         throws IOException

Writes array of `float`s.

Specified by:
  `writeFloatArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### reset

    public void reset()

Resets data output.

Specified by:
  `reset` in interface `GridDataOutput`

#### writeByteArray

    public void writeByteArray(byte[] arr)
                        throws IOException

Writes array of `byte`s.

Specified by:
  `writeByteArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeShortArray

    public void writeShortArray(short[] arr)
                         throws IOException

Writes array of `short`s.

Specified by:
  `writeShortArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### writeIntArray

    public void writeIntArray(int[] arr)
                       throws IOException

Writes array of `int`s.

Specified by:
  `writeIntArray` in interface `GridDataOutput`
Parameters:
  `arr` - Array.
Throws:
  `IOException` - In case of error.

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Overrides:
  `close` in class `OutputStream`
Throws:
  `IOException`

#### writeBoolean

    public void writeBoolean(boolean v)
                      throws IOException

Specified by:
  `writeBoolean` in interface `DataOutput`
Throws:
  `IOException`

#### writeByte

    public void writeByte(int v)
                   throws IOException

Specified by:
  `writeByte` in interface `DataOutput`
Throws:
  `IOException`

#### writeShort

    public void writeShort(int v)
                    throws IOException

Specified by:
  `writeShort` in interface `DataOutput`
Throws:
  `IOException`

#### writeChar

    public void writeChar(int v)
                   throws IOException

Specified by:
  `writeChar` in interface `DataOutput`
Throws:
  `IOException`

#### writeInt

    public void writeInt(int v)
                  throws IOException

Specified by:
  `writeInt` in interface `DataOutput`
Throws:
  `IOException`

#### writeLong

    public void writeLong(long v)
                   throws IOException

Specified by:
  `writeLong` in interface `DataOutput`
Throws:
  `IOException`

#### writeFloat

    public void writeFloat(float v)
                    throws IOException

Specified by:
  `writeFloat` in interface `DataOutput`
Throws:
  `IOException`

#### writeDouble

    public void writeDouble(double v)
                     throws IOException

Specified by:
  `writeDouble` in interface `DataOutput`
Throws:
  `IOException`

#### write

    public void write(int b)
               throws IOException

Specified by:
  `write` in interface `DataOutput`
Specified by:
  `write` in class `OutputStream`
Throws:
  `IOException`

#### writeBytes

    public void writeBytes(String s)
                    throws IOException

Specified by:
  `writeBytes` in interface `DataOutput`
Throws:
  `IOException`

#### writeChars

    public void writeChars(String s)
                    throws IOException

Specified by:
  `writeChars` in interface `DataOutput`
Throws:
  `IOException`

#### writeUTF

    public void writeUTF(String s)
                  throws IOException

Specified by:
  `writeUTF` in interface `DataOutput`
Throws:
  `IOException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.1.0
Release Date | : July 20 2017