Java Code Examples for com.alibaba.dubbo.common.serialize.support.java.CompactedObjectInputStream#readObject()

The following examples show how to use com.alibaba.dubbo.common.serialize.support.java.CompactedObjectInputStream#readObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Builder.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
@Override
public Serializable parseFrom(GenericObjectInput in) throws IOException {
    byte b = in.read0();
    if (b == OBJECT_NULL)
        return null;
    if (b != OBJECT_STREAM)
        throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");

    UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
    CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
    try {
        return (Serializable) ois.readObject();
    } catch (ClassNotFoundException e) {
        throw new IOException(StringUtils.toString(e));
    }
}
 
Example 2
Source File: Builder.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public Serializable parseFrom(GenericObjectInput in) throws IOException
{
	byte b = in.read0();
	if( b == OBJECT_NULL )
		return null;
	if( b != OBJECT_STREAM )
		throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");

	UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
	CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
	try{ return (Serializable)ois.readObject(); }
	catch(ClassNotFoundException e){ throw new IOException(StringUtils.toString(e)); }
}
 
Example 3
Source File: Builder.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@Override
public Serializable parseFrom(GenericObjectInput in) throws IOException
{
	byte b = in.read0();
	if( b == OBJECT_NULL )
		return null;
	if( b != OBJECT_STREAM )
		throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");

	UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
	CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
	try{ return (Serializable)ois.readObject(); }
	catch(ClassNotFoundException e){ throw new IOException(StringUtils.toString(e)); }
}
 
Example 4
Source File: Builder.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public Serializable parseFrom(GenericObjectInput in) throws IOException
{
	byte b = in.read0();
	if( b == OBJECT_NULL )
		return null;
	if( b != OBJECT_STREAM )
		throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");

	UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
	CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
	try{ return (Serializable)ois.readObject(); }
	catch(ClassNotFoundException e){ throw new IOException(StringUtils.toString(e)); }
}
 
Example 5
Source File: Builder.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public Serializable parseFrom(GenericObjectInput in) throws IOException
{
	byte b = in.read0();
	if( b == OBJECT_NULL )
		return null;
	if( b != OBJECT_STREAM )
		throw new IOException("Input format error, expect OBJECT_NULL|OBJECT_STREAM, get " + b + ".");

	UnsafeByteArrayInputStream bis = new UnsafeByteArrayInputStream(in.read0(in.readUInt()));
	CompactedObjectInputStream ois = new CompactedObjectInputStream(bis);
	try{ return (Serializable)ois.readObject(); }
	catch(ClassNotFoundException e){ throw new IOException(StringUtils.toString(e)); }
}