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 onUnsafeoperations.
-
-
Constructor Summary
Constructors Constructor Description GridUnsafeDataOutput()GridUnsafeDataOutput(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]array()voidbytes(byte[] bytes, int off)voidclose()byte[]internalArray()intoffset()voidoffset(int off)voidoutputStream(OutputStream out)voidreset()Resets data output.StringtoString()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwriteBoolean(boolean v)voidwriteBooleanArray(boolean[] arr)Writes array ofbooleans.voidwriteByte(int v)voidwriteByteArray(byte[] arr)Writes array ofbytes.voidwriteBytes(String s)voidwriteChar(int v)voidwriteCharArray(char[] arr)Writes array ofchars.voidwriteChars(String s)voidwriteDouble(double v)voidwriteDoubleArray(double[] arr)Writes array ofdoubles.voidwriteFloat(float v)voidwriteFloatArray(float[] arr)Writes array offloats.voidwriteInt(int v)voidwriteIntArray(int[] arr)Writes array ofints.voidwriteLong(long v)voidwriteLongArray(long[] arr)Writes array oflongs.voidwriteShort(int v)voidwriteShortArray(short[] arr)Writes array ofshorts.voidwriteUTF(String s)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
-
-
-
Method Detail
-
bytes
public void bytes(byte[] bytes, int off)- Parameters:
bytes- Bytes.off- Offset.
-
outputStream
public void outputStream(OutputStream out)
- Specified by:
outputStreamin interfaceGridDataOutput- Parameters:
out- Underlying output stream.
-
array
public byte[] array()
- Specified by:
arrayin interfaceGridDataOutput- Returns:
- Copy of internal array shrunk to offset.
-
internalArray
public byte[] internalArray()
- Specified by:
internalArrayin interfaceGridDataOutput- Returns:
- Internal array.
-
offset
public int offset()
- Specified by:
offsetin interfaceGridDataOutput- Returns:
- Offset.
-
offset
public void offset(int off)
- Specified by:
offsetin interfaceGridDataOutput- Parameters:
off- Offset.
-
write
public void write(byte[] b) throws IOException- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
writeDoubleArray
public void writeDoubleArray(double[] arr) throws IOExceptionWrites array ofdoubles.- Specified by:
writeDoubleArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeBooleanArray
public void writeBooleanArray(boolean[] arr) throws IOExceptionWrites array ofbooleans.- Specified by:
writeBooleanArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeCharArray
public void writeCharArray(char[] arr) throws IOExceptionWrites array ofchars.- Specified by:
writeCharArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeLongArray
public void writeLongArray(long[] arr) throws IOExceptionWrites array oflongs.- Specified by:
writeLongArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeFloatArray
public void writeFloatArray(float[] arr) throws IOExceptionWrites array offloats.- Specified by:
writeFloatArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
reset
public void reset()
Resets data output.- Specified by:
resetin interfaceGridDataOutput
-
writeByteArray
public void writeByteArray(byte[] arr) throws IOExceptionWrites array ofbytes.- Specified by:
writeByteArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeShortArray
public void writeShortArray(short[] arr) throws IOExceptionWrites array ofshorts.- Specified by:
writeShortArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
writeIntArray
public void writeIntArray(int[] arr) throws IOExceptionWrites array ofints.- Specified by:
writeIntArrayin interfaceGridDataOutput- Parameters:
arr- Array.- Throws:
IOException- In case of error.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
-