Examples of TypedData


Examples of net.sf.myway.gps.garmin.unit.TypedData

    if (_linkProtocol.getType(message).equals(DataTypeName.ACKNOWLEDGE)) {
      final CommandId cmd = message.getData().getCommandId();
      if (cmd.getId() == _linkProtocol.getId(_typeSent)) {
        if (_typeSent.equals(DataTypeName.RECORDS)) {
          _packageIndex = 0;
          final TypedData d = _packageData[_packageIndex++];
          _typeSent = d.getType();
          _linkProtocol.sendPackage(d.getType(), d.getData(), false);
        }
        else if (_typeSent.equals(DataTypeName.WPT_DATA)) {
          if (_packageIndex < _packageData.length) {
            final TypedData d = _packageData[_packageIndex++];
            _typeSent = d.getType();
            _linkProtocol.sendPackage(d.getType(), d.getData(), false);
          }
          else {
            final GarminData gd = new GarminData(new byte[2]);
            gd.setInt(0, _linkProtocol.getId(_typeToSend));
            _typeSent = DataTypeName.XFER_CMPLT;
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );

            if ( IS_DEBUG )
            {
                LOG.debug( "TypedData created" );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, TypedDataContainer typedDataContainer )
    {
        TypedData typedData = typedDataContainer.getTypedData();
        typedData.createNewTD();
        typedData.setCurrentDataType( value );

        typedDataContainer.setGrammarEndAllowed( true );
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData().size() );
        assertEquals( 2, typedData.getTypedData().size() );

        String[] expected = new String[]
            { "abcdef", "ghi" };
        int i = 0;

        for ( TypedData.TD td : typedData.getTypedData() )
        {
            assertEquals( 2, td.getDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), td.getDataValue() ) );
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( typedData.computeLength() );

        try
        {
            bb = typedData.encode( bb );

            // Check the length
            assertEquals( 0x21, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

        TypedDataContainer typedDataContainer = new TypedDataContainer();

        kerberosDecoder.decode( stream, typedDataContainer );

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData() );
        assertEquals( 1, typedData.getTypedData().size() );
        assertEquals( 2, typedData.getCurrentTD().getDataType() );
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );

            if ( IS_DEBUG )
            {
                LOG.debug( "TypedData created" );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData().size() );
        assertEquals( 2, typedData.getTypedData().size() );

        String[] expected = new String[]
            { "abcdef", "ghi" };
        int i = 0;

        for ( TypedData.TD td : typedData.getTypedData() )
        {
            assertEquals( 2, td.getDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), td.getDataValue() ) );
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( typedData.computeLength() );

        try
        {
            bb = typedData.encode( bb );

            // Check the length
            assertEquals( 0x21, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

        TypedDataContainer typedDataContainer = new TypedDataContainer();

        kerberosDecoder.decode( stream, typedDataContainer );

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData() );
        assertEquals( 1, typedData.getTypedData().size() );
        assertEquals( 2, typedData.getCurrentTD().getDataType() );
    }
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );


            if ( IS_DEBUG )
            {
View Full Code Here

Examples of org.apache.directory.shared.kerberos.components.TypedData

     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, TypedDataContainer typedDataContainer )
    {
        TypedData typedData = typedDataContainer.getTypedData();
        typedData.createNewTD();
        typedData.setCurrentDataType( value );

        typedDataContainer.setGrammarEndAllowed( true );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.