com.alibaba.dubbo.common.serialize.support.java
Class JavaObjectInput

java.lang.Object
  extended by com.alibaba.dubbo.common.serialize.support.nativejava.NativeJavaObjectInput
      extended by com.alibaba.dubbo.common.serialize.support.java.JavaObjectInput
All Implemented Interfaces:
DataInput, ObjectInput

public class JavaObjectInput
extends NativeJavaObjectInput

Java Object input.

Author:
qian.lei

Field Summary
static int MAX_BYTE_ARRAY_LENGTH
           
 
Constructor Summary
JavaObjectInput(InputStream is)
           
JavaObjectInput(InputStream is, boolean compacted)
           
 
Method Summary
 byte[] readBytes()
          Read byte array.
 Object readObject()
          read object.
<T> T
readObject(Class<T> cls)
          read object.
<T> T
readObject(Class<T> cls, Type type)
          read object.
 String readUTF()
          Read UTF-8 string.
 
Methods inherited from class com.alibaba.dubbo.common.serialize.support.nativejava.NativeJavaObjectInput
readBool, readByte, readDouble, readFloat, readInt, readLong, readShort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BYTE_ARRAY_LENGTH

public static final int MAX_BYTE_ARRAY_LENGTH
See Also:
Constant Field Values
Constructor Detail

JavaObjectInput

public JavaObjectInput(InputStream is)
                throws IOException
Throws:
IOException

JavaObjectInput

public JavaObjectInput(InputStream is,
                       boolean compacted)
                throws IOException
Throws:
IOException
Method Detail

readBytes

public byte[] readBytes()
                 throws IOException
Description copied from interface: DataInput
Read byte array.

Specified by:
readBytes in interface DataInput
Overrides:
readBytes in class NativeJavaObjectInput
Returns:
byte array.
Throws:
IOException

readUTF

public String readUTF()
               throws IOException
Description copied from interface: DataInput
Read UTF-8 string.

Specified by:
readUTF in interface DataInput
Overrides:
readUTF in class NativeJavaObjectInput
Returns:
string.
Throws:
IOException

readObject

public Object readObject()
                  throws IOException,
                         ClassNotFoundException
Description copied from interface: ObjectInput
read object.

Specified by:
readObject in interface ObjectInput
Overrides:
readObject in class NativeJavaObjectInput
Returns:
object.
Throws:
IOException
ClassNotFoundException

readObject

public <T> T readObject(Class<T> cls)
             throws IOException,
                    ClassNotFoundException
Description copied from interface: ObjectInput
read object.

Specified by:
readObject in interface ObjectInput
Overrides:
readObject in class NativeJavaObjectInput
Parameters:
cls - object type.
Returns:
object.
Throws:
IOException
ClassNotFoundException

readObject

public <T> T readObject(Class<T> cls,
                        Type type)
             throws IOException,
                    ClassNotFoundException
Description copied from interface: ObjectInput
read object.

Specified by:
readObject in interface ObjectInput
Overrides:
readObject in class NativeJavaObjectInput
Parameters:
cls - object type.
Returns:
object.
Throws:
IOException
ClassNotFoundException


Copyright © 2012–2017 Alibaba. All rights reserved.