Package de.netseeker.ejoe.io

Examples of de.netseeker.ejoe.io.ChannelInputStream


    private Object readBlocked( SerializeAdapter adapter ) throws Exception
    {
        // usual way: deserialize using a adapter
        if ( !this._senderInfo.isDirect() )
        {
            return deserialize( adapter, new ChannelInputStream( Channels
                    .newInputStream( this._senderInfo.getChannel() ) ) );
        }
        // direct mode: don't deserialize, just copy and return the read
        // ByteBuffer
        else
        {
            return IOUtil
                    .readDirect( new ChannelInputStream( Channels.newInputStream( this._senderInfo.getChannel() ) ) );
        }
    }
View Full Code Here


        {
            serialize( Channels.newOutputStream( _channel ), obj, clientInfo );
            // default mode: deserialize the server response
            if ( !clientInfo.isMixed() )
            {
                result = deserialize( new ChannelInputStream( Channels.newInputStream( _channel ) ), clientInfo );
            }
            // mixed mode: don't deserialize the server response
            else
            {
                result = IOUtil.readDirect( new ChannelInputStream( Channels.newInputStream( _channel ) ) );
            }
        }
        // direct mode: don't (de)serialize, just copy and return the read
        // ByteBuffer
        else
        {
            ByteBuffer tmp = (ByteBuffer) obj;
            if ( tmp.position() > 0 )
            {
                tmp.flip();
            }
            IOUtil.writeDirect( Channels.newOutputStream( _channel ), tmp );
            result = IOUtil.readDirect( new ChannelInputStream( Channels.newInputStream( _channel ) ) );
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of de.netseeker.ejoe.io.ChannelInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.