Package bm.core.io

Examples of bm.core.io.SerializerInputStream


            out.writeLong( crc );
            pe.setMessage( ResourceManager.getResource( "bm.net.rpc.WaitingResponse" ) );
            pe.dispatch();
            log.debug( "Call serialized" );
            final DataInputStream is = binding.endPost();
            final SerializerInputStream in = new SerializerInputStream( is );
            pe.setMessage( ResourceManager.getResource( "bm.net.rpc.ReadingResponse" ) );
            pe.dispatch();
            final int responseCode = in.readInt();
            final String responseMessage = in.readString();
            if( responseCode == Net.RC_SUCCESS )
            {
                return in.readNullableObject();
            }
            else if( responseCode != Net.RC_INVALID_CRC )
            {
                log.error( "Unrecoverable error: " + responseCode + " " + responseMessage );
                throw new RemoteCallException(
View Full Code Here


     */
    protected ScriptingClass load( final InputStream is, final String name )
            throws SerializationException
    {
        startLoad( name );
        final SerializerInputStream in = new SerializerInputStream( is );
        final ScriptingClass clazz = new ScriptingClass( vm );
        clazz.deserialize( in );
        if( proxies.containsKey( name ) )
        {
            final ScriptingClassProxy proxy =
View Full Code Here

        try
        {
            //log.debug( "loadRecord( " + recordId + " )" );
            final byte[] data = rs.getRecord( recordId );
            final ByteArrayInputStream bais = new ByteArrayInputStream( data );
            final SerializerInputStream in = new SerializerInputStream(
                    useCompression() ? (InputStream) new ZInputStream( bais ) : bais
            );
            if( currentRecord == null )
            {
                currentRecord = new Record( recordId, info.multiplexer );
View Full Code Here

    public void read( final byte[] data )
            throws SerializationException
    {
        final ByteArrayInputStream bais = new ByteArrayInputStream( data );
        final SerializerInputStream in = new SerializerInputStream( bais );

        in.readByte(); // skip version

        id = in.readInt();
        title = in.readString();
        controller = in.readNullableString();

        actions.removeAllElements();
        int count = in.readInt();
        if( count > 0 )
        {
            for( int i = 0; i < count; i++ )
            {
                final ActionDef action = new ActionDef();
                action.read( in );
                actions.addElement( action );
            }
        }

        attachments.removeAllElements();
        count = in.readInt();
        if( count > 0 )
        {
            for( int i = 0; i < count; i++ )
            {
                final AttachmentDef attachment = new AttachmentDef();
View Full Code Here

    public void read( final byte[] data )
            throws SerializationException
    {
        final ByteArrayInputStream bais = new ByteArrayInputStream( data );
        final SerializerInputStream in = new SerializerInputStream( bais );

        in.readByte(); // skip version
        source = in.readString();
        width = in.readInt();
        height = in.readInt();
    }
View Full Code Here

    public void read( final byte[] data )
            throws SerializationException
    {
        final ByteArrayInputStream bais = new ByteArrayInputStream( data );
        final SerializerInputStream in = new SerializerInputStream( bais );

        in.readByte(); // skip version
        className = in.readString();
    }
View Full Code Here

            final Index index = new Index( "sample", 2, Index.KT_STRING, true );
            final NodeKey key = new NodeKey( index, new IndexKey( "MyKey" ), array );
            key.serialize( out );
            final NodeKey key2 = new NodeKey( index, new IndexKey( "MyKey2" ), array2 );
            final ByteArrayInputStream bais = new ByteArrayInputStream( baos.toByteArray() );
            final SerializerInputStream in = new SerializerInputStream( bais );
            key2.deserialize( in );
            assertEquals( key.getKey(), key2.getKey() );
            final SortedIntArray key2Data = (SortedIntArray) key2.getData();
            assertNotNull( key2Data );
            assertEquals( 1, key2Data.size() );
View Full Code Here

            final Index index = new Index( "sample", 2, Index.KT_LONG, true );
            final NodeKey key = new NodeKey( index, new IndexKey( new Long( 1 ) ), array );
            key.serialize( out );
            final NodeKey key2 = new NodeKey( index, new IndexKey( new Long( 2 ) ), array2 );
            final ByteArrayInputStream bais = new ByteArrayInputStream( baos.toByteArray() );
            final SerializerInputStream in = new SerializerInputStream( bais );
            key2.deserialize( in );
            assertEquals( key.getKey(), key2.getKey() );
            final SortedIntArray data = (SortedIntArray) key2.getData();
            assertNotNull( data );
            assertEquals( 1, data.size() );
View Full Code Here

            final SerializerOutputStream out = new SerializerOutputStream( baos );
            array.serialize( out );
            final byte[] data = baos.toByteArray();
            final SortedIntArray newArray = new SortedIntArray( 16, 16 );
            final ByteArrayInputStream bais = new ByteArrayInputStream( data );
            final SerializerInputStream in = new SerializerInputStream( bais );
            newArray.deserialize( in );
            assertEquals( array.size(), newArray.size() );
            for( int i = 0; i < array.size(); i++ )
            {
                assertEquals( array.getElementAt( i ), newArray.getElementAt( i ) );
View Full Code Here

                            );
                        }
                    }
                    rs.getRecord( recordId, data, 0 );
                    ByteArrayInputStream bais = new ByteArrayInputStream( data, 0, recordSize );
                    SerializerInputStream in = new SerializerInputStream( bais );
                    rowType = in.readByte();
                    switch( rowType )
                    {
                        case Constants.DBRT_TABLE_INFO:
                            final TableInfo info = new TableInfo();
                            info.deserialize( in );
View Full Code Here

TOP

Related Classes of bm.core.io.SerializerInputStream

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.