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 onUnsafeoperations.
-
-
Constructor Summary
Constructors Constructor Description GridUnsafeDataInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbytes(byte[] bytes, int len)voidbytes(byte[] bytes, int off, int len)voidinputStream(InputStream in)intread()intread(byte[] b, int off, int len)booleanreadBoolean()boolean[]readBooleanArray()Reads array ofbooleans.bytereadByte()byte[]readByteArray()Reads array ofbytes.charreadChar()char[]readCharArray()Reads array ofchars.doublereadDouble()double[]readDoubleArray()Reads array ofdoubles.floatreadFloat()float[]readFloatArray()Reads array offloats.voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()int[]readIntArray()Reads array ofints.StringreadLine()longreadLong()long[]readLongArray()Reads array oflongs.shortreadShort()short[]readShortArray()Reads array ofshorts.intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidreset()Resets data output.intskipBytes(int n)StringtoString()-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
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
-
-
-
-
Method Detail
-
bytes
public void bytes(byte[] bytes, int len)- Specified by:
bytesin interfaceGridDataInput- 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:
inputStreamin interfaceGridDataInput- Parameters:
in- Underlying input stream.- Throws:
IOException- In case of error.
-
reset
public void reset() throws IOExceptionResets data output.- Specified by:
resetin interfaceGridDataInput- Overrides:
resetin classInputStream- Throws:
IOException- In case of error.
-
readByteArray
public byte[] readByteArray() throws IOExceptionReads array ofbytes.- Specified by:
readByteArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readShortArray
public short[] readShortArray() throws IOExceptionReads array ofshorts.- Specified by:
readShortArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readIntArray
public int[] readIntArray() throws IOExceptionReads array ofints.- Specified by:
readIntArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readDoubleArray
public double[] readDoubleArray() throws IOExceptionReads array ofdoubles.- Specified by:
readDoubleArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readBooleanArray
public boolean[] readBooleanArray() throws IOExceptionReads array ofbooleans.- Specified by:
readBooleanArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readCharArray
public char[] readCharArray() throws IOExceptionReads array ofchars.- Specified by:
readCharArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readLongArray
public long[] readLongArray() throws IOExceptionReads array oflongs.- Specified by:
readLongArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readFloatArray
public float[] readFloatArray() throws IOExceptionReads array offloats.- Specified by:
readFloatArrayin interfaceGridDataInput- Returns:
- Array.
- Throws:
IOException- In case of error.
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin interfaceGridDataInput- Specified by:
readin classInputStream- Returns:
- The next byte of data, or
-1if 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:
readin interfaceGridDataInput- Overrides:
readin classInputStream- 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
-1is 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:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
-