Class GridUnsafeDataInput
java.lang.Object
java.io.InputStream
org.gridgain.internal.dr.optimized.GridUnsafeDataInput
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable,org.apache.ignite.internal.util.io.IgniteDataInput
public class GridUnsafeDataInput
extends InputStream
implements org.apache.ignite.internal.util.io.IgniteDataInput
Data input based on
Unsafe operations compatible with GG-8 implementation.-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new input with auto-shrinking disabled and no internal buffer assigned.GridUnsafeDataInput(byte[] bytes) Creates a new input with auto-shrinking disabled.GridUnsafeDataInput(byte[] bytes, long shrinkCheckFrequencyMs) Creates a new input.GridUnsafeDataInput(long shrinkCheckFrequencyMs) Creates a new input with no internal buffer assigned. -
Method Summary
Modifier and TypeMethodDescriptionintvoidbytes(byte[] bytes, int len) voidbytes(byte[] bytes, int off, int len) Sets the internal buffer.voidcleanup()voidvoidmark(int readLimit) boolean<T> TmaterializeFromNextBytes(int bytesCount, org.apache.ignite.internal.util.io.IgniteDataInput.Materializer<? extends T> materializer) intread()intread(byte[] b, int off, int len) booleanboolean[]readBooleanArray(int arrSize) bytereadByte()byte[]readByteArray(int arrSize) charreadChar()char[]readCharArray(int arrSize) doubledouble[]readDoubleArray(int arrSize) intreadFewBytes(byte[] b, int off, int len) floatfloat[]readFloatArray(int arrSize) voidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()int[]readIntArray(int arrSize) readLine()longreadLong()long[]readLongArray(int arrSize) shortshort[]readShortArray(int arrSize) intintreadUTF()protected StringreadUtfBody(long utfLen) Reads in the "body" (i.e., the UTF representation minus the 2-byte or 8-byte length header) of a UTF encoding, which occupies the next utfLen bytes.readUuid()longvoidreset()intskipBytes(int n) toString()Methods inherited from class java.io.InputStream
close, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.ignite.internal.util.io.IgniteDataInput
read, readAllBytes, readCollection, readMap, readVarIntAsInt
-
Constructor Details
-
GridUnsafeDataInput
public GridUnsafeDataInput()Creates a new input with auto-shrinking disabled and no internal buffer assigned. -
GridUnsafeDataInput
public GridUnsafeDataInput(long shrinkCheckFrequencyMs) Creates a new input with no internal buffer assigned.- Parameters:
shrinkCheckFrequencyMs- how often to check whether an underlying byte buffer needs to be shrunk (disables the auto-shrinking if it's -1)
-
GridUnsafeDataInput
public GridUnsafeDataInput(byte[] bytes) Creates a new input with auto-shrinking disabled.- Parameters:
bytes- array to initially (before automatic resize) use as an internal buffer
-
GridUnsafeDataInput
public GridUnsafeDataInput(byte[] bytes, long shrinkCheckFrequencyMs) Creates a new input.- Parameters:
bytes- array to initially (before automatic resize) use as an internal buffershrinkCheckFrequencyMs- how often to check whether an underlying byte buffer needs to be shrunk (disables the auto-shrinking if it's -1)
-
-
Method Details
-
bytes
public void bytes(byte[] bytes, int len) - Specified by:
bytesin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput
-
bytes
public void bytes(byte[] bytes, int off, int len) Sets the internal buffer.- Parameters:
bytes- Bytes.off- Offset.len- Length.
-
inputStream
- Specified by:
inputStreamin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
reset
- Specified by:
resetin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Overrides:
resetin classInputStream- Throws:
IOException
-
cleanup
- Specified by:
cleanupin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readByteArray
- Specified by:
readByteArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readShortArray
- Specified by:
readShortArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readIntArray
- Specified by:
readIntArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readDoubleArray
- Specified by:
readDoubleArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readBooleanArray
- Specified by:
readBooleanArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readCharArray
- Specified by:
readCharArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readBigInteger
- Specified by:
readBigIntegerin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readBigDecimal
- Specified by:
readBigDecimalin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readLocalTime
- Specified by:
readLocalTimein interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readLocalDate
- Specified by:
readLocalDatein interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readLocalDateTime
- Specified by:
readLocalDateTimein interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readInstant
- Specified by:
readInstantin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readDuration
- Specified by:
readDurationin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readPeriod
- Specified by:
readPeriodin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readUuid
- Specified by:
readUuidin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readBitSet
- Specified by:
readBitSetin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readLongArray
- Specified by:
readLongArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readFloatArray
- Specified by:
readFloatArrayin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readFewBytes
- Specified by:
readFewBytesin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) -
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
read
- Specified by:
readin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Specified by:
readin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Overrides:
readin classInputStream- Throws:
IOException
-
readVarInt
- Specified by:
readVarIntin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readUtfBody
Reads in the "body" (i.e., the UTF representation minus the 2-byte or 8-byte length header) of a UTF encoding, which occupies the next utfLen bytes.- Parameters:
utfLen- UTF encoding length.- Returns:
- String.
- Throws:
IOException- In case of error.
-
mark
public void mark(int readLimit) - Specified by:
markin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
available
- Specified by:
availablein interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Overrides:
availablein classInputStream- Throws:
IOException
-
materializeFromNextBytes
public <T> T materializeFromNextBytes(int bytesCount, org.apache.ignite.internal.util.io.IgniteDataInput.Materializer<? extends T> materializer) throws IOException - Specified by:
materializeFromNextBytesin interfaceorg.apache.ignite.internal.util.io.IgniteDataInput- Throws:
IOException
-
toString
-