public boolean createFromStream(BitBuffer buf, TileMapFormatDesc desc,
        TileMap tileMap, TileFeature prevFeature ){
    
        // Create TileFeature of correct dynamic type.
        boolean sameAsPrevious = buf.nextBits(1) != 0;
        int type;
        if ( sameAsPrevious ) {
            // Same as previous.
            type = prevFeature.getType();
        } else {
            // Not same as previous.
            // Read the actual type.
            type = buf.nextSignedBits(8);  //nextByte();
        }

        this.type = type;
        TileFeatureArg[] args = desc.getArgsForFeatureType(type);
                
        if (args == null) {
            if(LOG.isError()) {
                LOG.error("TileFeature.createFromStream()", "Could not find args for feature of type "+type);
            }
            return false;
        }
        
        tileFeatureArgs = new TileFeatureArg[args.length];        
        internalTileFeatureArgs = args;
        
        // Load the feature with internalLoad.
        // Supply the previous feature if it is of the same type.
        if(!internalLoad( type,buf, tileMap, sameAsPrevious ? prevFeature : null  )){
            return false;
        }
        
        return true;
    }