Package com.esotericsoftware.kryo.io
Class KryoDataInput
- java.lang.Object
-
- com.esotericsoftware.kryo.io.KryoDataInput
-
- All Implemented Interfaces:
java.io.DataInput
,java.lang.AutoCloseable
- Direct Known Subclasses:
KryoObjectInput
public class KryoDataInput extends java.lang.Object implements java.io.DataInput, java.lang.AutoCloseable
ADataInput
which reads from anInput
.readLine()
is unsupported. Other methods behave slightly differently, egreadUTF()
may return a null string.- Author:
- Robert DiFalco
-
-
Constructor Summary
Constructors Constructor Description KryoDataInput(Input input)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
boolean
readBoolean()
byte
readByte()
char
readChar()
double
readDouble()
float
readFloat()
void
readFully(byte[] b)
void
readFully(byte[] b, int off, int len)
int
readInt()
java.lang.String
readLine()
Deprecated.this method is not supported in this implementation.long
readLong()
short
readShort()
int
readUnsignedByte()
int
readUnsignedShort()
java.lang.String
readUTF()
Reads the length and string of UTF8 characters, or null.void
setInput(Input input)
int
skipBytes(int n)
-
-
-
Field Detail
-
input
protected Input input
-
-
Constructor Detail
-
KryoDataInput
public KryoDataInput(Input input)
-
-
Method Detail
-
setInput
public void setInput(Input input)
-
readFully
public void readFully(byte[] b) throws java.io.IOException
- Specified by:
readFully
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException
- Specified by:
skipBytes
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readBoolean
public boolean readBoolean() throws java.io.IOException
- Specified by:
readBoolean
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException
- Specified by:
readByte
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException
- Specified by:
readUnsignedByte
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException
- Specified by:
readShort
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOException
- Specified by:
readUnsignedShort
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOException
- Specified by:
readChar
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException
- Specified by:
readInt
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException
- Specified by:
readLong
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException
- Specified by:
readFloat
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException
- Specified by:
readDouble
in interfacejava.io.DataInput
- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.lang.UnsupportedOperationException
Deprecated.this method is not supported in this implementation.Not implemented.- Specified by:
readLine
in interfacejava.io.DataInput
- Throws:
java.lang.UnsupportedOperationException
- when called.
-
readUTF
public java.lang.String readUTF() throws java.io.IOException
Reads the length and string of UTF8 characters, or null. This can read strings written byKryoDataOutput.writeUTF(String)
,Output.writeString(String)
, andOutput.writeAscii(String)
.- Specified by:
readUTF
in interfacejava.io.DataInput
- Returns:
- May be null.
- Throws:
java.io.IOException
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-