Hola!

Registrándote como bakuno podrás publicar, compartir y comunicarte en privado con otros bakuos :D

Regístrame ya!

Compilar archivo .java (a .class)

usbsound

Bovino adolescente
Desde
13 Sep 2007
Mensajes
72
Hola, buen día bakunos, el motivo de este tema es para pedirles ayuda sobre como compilar un archivo .java (a .class) o si ya de plano me pueden hacer el favor de compilarlo, ya que solo me hace falta ese archivo. class, para ser exactos son dos archivos. He tratado de compilarlo con el programa DJ Java Decompiler pero me manda el siguiente mensaje:

2012-03-30_00034.jpg


y ya no se que más hacer, por eso recurro a ustedes.

Tambien anexo el codigo de los dos archivos en comento para saber si alguien me puede echar una ayudadita en converitrlos a .class.

Archivo 1: Mp3Tag.java (Quiero convertirlo a Mp3Tag.class)

Código:
package com.gowtham.jmp3tag;

import java.io.IOException;
import java.io.PrintStream;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

// Referenced classes of package com.gowtham.jmp3tag:
//            Logger, FileBrowser, SettingsForm, Preferences, 
//            Tag, APICTag, Frame, FileBrowserEvent, 
//            SettingsEvent

public class Mp3Tag extends MIDlet
    implements CommandListener, FileBrowserEvent, Runnable, SettingsEvent
{

    public Mp3Tag()
    {
        imageForm = null;
        showImageCmd = null;
        backFromImageFormCmd = null;
        configureSettingsCmd = null;
        deleteArtCmd = null;
        logger = new Logger("Logger", this);
        initialize();
        ticker = new Ticker("Select Browse to load a MP3 file");
        tagEditor.setTicker(ticker);
        if(progressForm == null)
            progressForm = new Form("Saving...");
        if(gauge == null)
        {
            gauge = new Gauge("Progress", false, 100, 0);
            gauge.setLabel("Progress");
        }
        progressForm.append(gauge);
        showLogCommand = new Command("View Log", 1, 10);
        if(fileBrowser == null)
            fileBrowser = new FileBrowser("MP3 browser", this, "/", new String[] {
                "mp3"
            }, false, this);
        if(imageBrowser == null)
            imageBrowser = new FileBrowser("Image browser", this, "/", new String[] {
                "jpg", "png", "bmp", "gif"
            }, false, this);
        if(imageForm == null)
            imageForm = new Form("Album Art");
        replaceArtCommand = new Command("Replace", 1, 0);
        imageForm.addCommand(replaceArtCommand);
        showImageCmd = new Command("Album Art...", "Album Art...", 1, 100);
        backFromImageFormCmd = new Command("Back", "Back", 1, 0);
        deleteArtCmd = new Command("Delete", "Delete Image", 1, 1);
        imageForm.addCommand(backFromImageFormCmd);
        imageForm.setCommandListener(this);
        tagEditor.addCommand(showImageCmd);
        tagEditor.addCommand(showLogCommand);
        settingsForm = new SettingsForm(this);
        settingsForm.setListener(this);
        printf("Preferences loading");
        try
        {
            pref = new Preferences("settings");
            String s = pref.get("overwrite");
            printf("Overwrite mode read: " + s);
            if(s != null)
                settingsForm.setOvewrite(s);
            String s1 = pref.get("sort");
            if(s1 != null)
            {
                printf("Sort mode read: " + s1);
                settingsForm.setSort(s1);
            }
            String s2 = pref.get("showticker");
            if(s2 != null)
            {
                printf("Show ticker read: " + s2);
                settingsForm.setShowTicker(s2);
                if(s2.equalsIgnoreCase("No"))
                    tagEditor.setTicker(null);
            }
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
        }
        configureSettingsCmd = new Command("Settings...", "Settings...", 1, 10);
        tagEditor.addCommand(configureSettingsCmd);
        setupImages();
    }

    public void populateTextBoxes(Tag tag1)
    {
        try
        {
            textFieldAlbum.setString(tag1.getAlbum());
            textFieldArtist.setString(tag1.getArtist());
            textFieldTitle.setString(tag1.getTitile());
            textFieldYear.setString(tag1.getYear());
            textFieldGenre.setString(tag1.getGenre());
        }
        catch(Exception exception)
        {
            ticker.setString(exception.toString());
        }
    }

    public void commandAction(Command command, Displayable displayable)
    {
        if(displayable == tagEditor)
        {
            if(command == cmdBrowseFile)
                fileBrowser.show(getDisplay().getCurrent());
            else
            if(command == cmdExit)
                exitMIDlet();
            else
            if(command == cmdAbout)
                info("JMp3Tag v0.8 by Gowtham, built on 3 May 2011\n\nEmail: [email protected]", "About");
            else
            if(command == cmdSaveTags)
                (new Thread(new Runnable() {

                    public void run()
                    {
                        handleSave();
                    }

                }
)).start();
            else
            if(command == cmdHelp)
                info("This program helps to edit the tags in MP3 files. Your phone should have support for JSR-75 API. To minimize the number of confirmation dialogs, grant the 'Read user data' and 'Write user data' permissions to this application.", "Help");
            else
            if(command == showImageCmd)
            {
                loadImage();
                Display.getDisplay(this).setCurrent(imageForm);
            } else
            if(command == configureSettingsCmd)
                settingsForm.show();
            else
            if(command == showLogCommand)
                logger.show(tagEditor);
        } else
        if(displayable == imageForm)
            if(command == backFromImageFormCmd)
                Display.getDisplay(this).setCurrent(tagEditor);
            else
            if(command == deleteArtCmd)
            {
                tag.deleteAPICFrame();
                ticker.setString("Remember to select Save to remove the art");
                Display.getDisplay(this).setCurrent(tagEditor);
            } else
            if(command == replaceArtCommand)
            {
                logger.log("Showing image browser");
                imageBrowser.show(imageForm);
            }
    }

    private void initialize()
    {
        getDisplay().setCurrent(get_tagEditor());
    }

    public Display getDisplay()
    {
        return Display.getDisplay(this);
    }

    public void exitMIDlet()
    {
        getDisplay().setCurrent(null);
        destroyApp(true);
        notifyDestroyed();
    }

    public Form get_tagEditor()
    {
        if(tagEditor == null)
        {
            tagEditor = new Form("JMp3Tag", new Item[] {
                get_textFieldPath(), get_textFieldTitle(), get_textFieldAlbum(), get_textFieldArtist(), get_textFieldYear(), get_textFieldGenre()
            });
            tagEditor.addCommand(get_cmdBrowseFile());
            tagEditor.addCommand(get_cmdSaveTags());
            tagEditor.addCommand(get_cmdExit());
            tagEditor.addCommand(get_cmdAbout());
            tagEditor.addCommand(get_cmdHelp());
            tagEditor.setCommandListener(this);
        }
        return tagEditor;
    }

    public Command get_cmdBrowseFile()
    {
        if(cmdBrowseFile == null)
            cmdBrowseFile = new Command("Browse", 1, 1);
        return cmdBrowseFile;
    }

    public Command get_cmdSaveTags()
    {
        if(cmdSaveTags == null)
            cmdSaveTags = new Command("Save", 1, 1);
        return cmdSaveTags;
    }

    public Command get_cmdExit()
    {
        if(cmdExit == null)
            cmdExit = new Command("Exit", 7, 1);
        return cmdExit;
    }

    public Command get_cmdAbout()
    {
        if(cmdAbout == null)
            cmdAbout = new Command("About", 1, 1);
        return cmdAbout;
    }

    public TextField get_textFieldPath()
    {
        if(textFieldPath == null)
            textFieldPath = new TextField("MP3 file", "", 1000, 0x20000);
        return textFieldPath;
    }

    public TextField get_textFieldTitle()
    {
        if(textFieldTitle == null)
            textFieldTitle = new TextField("Title", null, 120, 0);
        return textFieldTitle;
    }

    public TextField get_textFieldAlbum()
    {
        if(textFieldAlbum == null)
            textFieldAlbum = new TextField("Album", null, 120, 0);
        return textFieldAlbum;
    }

    public TextField get_textFieldArtist()
    {
        if(textFieldArtist == null)
            textFieldArtist = new TextField("Artist", null, 120, 0);
        return textFieldArtist;
    }

    public TextField get_textFieldYear()
    {
        if(textFieldYear == null)
            textFieldYear = new TextField("Year", null, 120, 0);
        return textFieldYear;
    }

    public TextField get_textFieldGenre()
    {
        if(textFieldGenre == null)
            textFieldGenre = new TextField("Genre", null, 120, 0);
        return textFieldGenre;
    }

    public Command get_cmdHelp()
    {
        if(cmdHelp == null)
            cmdHelp = new Command("Help", 1, 1);
        return cmdHelp;
    }

    public Command get_cmdCancel()
    {
        if(cmdCancel == null)
            cmdCancel = new Command("Cancel", 1, 1);
        return cmdCancel;
    }

    public void startApp()
    {
    }

    public void pauseApp()
    {
    }

    public void destroyApp(boolean flag)
    {
        saveSettings();
    }

    public void run()
    {
    }

    public void handleSave()
    {
        if(tag != null)
            try
            {
                gauge.setValue(0);
                getDisplay().setCurrent(progressForm);
                tag.setAlbum(textFieldAlbum.getString());
                tag.setArtist(textFieldArtist.getString());
                tag.setTitile(textFieldTitle.getString());
                tag.setYear(textFieldYear.getString());
                tag.setGenre(textFieldGenre.getString());
                ticker.setString("Saving... Please wait");
                tag.Save(gauge, settingsForm.canOverwrite());
                ticker.setString("Tags saved successfully");
                getDisplay().setCurrent(tagEditor);
            }
            catch(Exception exception)
            {
                ticker.setString(exception.toString());
                getDisplay().setCurrent(tagEditor);
            }
        else
            ticker.setString("No MP3 file loaded!");
    }

    public void info(String s, String s1)
    {
        Alert alert = new Alert(s1);
        alert.setType(AlertType.INFO);
        alert.setString(s);
        alert.setTimeout(-2);
        getDisplay().setCurrent(alert);
    }

    public void debug(String s)
    {
        Alert alert = new Alert("DEBUG");
        alert.setType(AlertType.INFO);
        alert.setString(s);
        alert.setTimeout(-2);
        getDisplay().setCurrent(alert);
    }

    public void error(String s)
    {
        Alert alert = new Alert("ERROR");
        alert.setType(AlertType.ERROR);
        alert.setString(s);
        alert.setTimeout(3000);
        getDisplay().setCurrent(alert);
    }

    public void handleRead()
    {
        tag = new Tag(textFieldPath.getString());
        try
        {
            tag.Read();
            if(tag.tagExists())
                ticker.setString("Tags loaded");
            else
                ticker.setString("No tags found");
        }
        catch(Exception exception)
        {
            ticker.setString(exception.toString());
        }
        populateTextBoxes(tag);
    }

    public void someThingSelected(FileBrowser filebrowser, String s)
    {
        if(filebrowser == fileBrowser)
        {
            textFieldPath.setString(s);
            handleRead();
        }
        if(filebrowser == imageBrowser)
        {
            Display.getDisplay(this).setCurrent(imageForm);
            replaceAlbumArt(s);
        }
    }

    private void loadImage()
    {
        imageForm.deleteAll();
        imageForm.removeCommand(deleteArtCmd);
        StringItem stringitem = new StringItem("Error: ", "");
        StringItem stringitem1 = new StringItem("Image type: ", "");
        StringItem stringitem2 = new StringItem("Description: ", "");
        if(tag == null)
        {
            imageForm.append(stringitem);
            stringitem.setText("No MP3 file loaded");
            return;
        }
        if(!tag.tagExists())
        {
            imageForm.append(stringitem);
            stringitem.setText("No tag exists in the loaded MP3 file");
            return;
        }
        byte abyte0[] = tag.getFrame("APIC");
        if(abyte0 == null)
        {
            imageForm.append(stringitem);
            stringitem.setText("No album art exists in the loaded MP3 file");
            return;
        } else
        {
            printf("Image exists");
            printf("Size : " + abyte0.length);
            APICTag apictag = new APICTag(abyte0);
            printf(apictag.getMimeType());
            printf(apictag.getDescription());
            stringitem1.setText(apictag.getMimeType());
            stringitem2.setText(apictag.getDescription());
            int i = apictag.getImageStartIndex();
            printf("Image length = " + apictag.getImageLength());
            printf("Bytes: " + Integer.toHexString(abyte0[i] & 0xff) + Integer.toHexString(abyte0[i + 1] & 0xff));
            Image image = Image.createImage(abyte0, i, apictag.getImageLength());
            imageForm.append(stringitem1);
            imageForm.append(stringitem2);
            imageForm.append(image);
            imageForm.addCommand(deleteArtCmd);
            return;
        }
    }

    private void printf(String s)
    {
        System.out.println(s);
    }

    public void settingsSaved()
    {
        String s = settingsForm.canOverwriteString();
        printf("Overwrite mode: " + s);
        if(s != null)
            pref.put("overwrite", s);
        String s1 = settingsForm.canSortString();
        printf("Sort mode: " + s1);
        if(s1 != null)
        {
            pref.put("sort", s1);
            fileBrowser.setSort(settingsForm.canSort());
        }
        String s2 = settingsForm.canShowTickerString();
        printf("Ticker show: " + s2);
        if(s2 != null)
            pref.put("showticker", s2);
        if(settingsForm.canShowTicker())
            tagEditor.setTicker(ticker);
        else
            tagEditor.setTicker(null);
    }

    private void saveSettings()
    {
        try
        {
            pref.save();
            printf("Save ok");
        }
        catch(Exception exception)
        {
            error("Error saving settings: " + exception.toString());
        }
    }

    private void replaceAlbumArt(String s)
    {
        tag.deleteAPICFrame();
        try
        {
            APICTag apictag = new APICTag(s);
            apictag.setLogger(logger);
            byte abyte0[] = apictag.toByteArray();
            Frame frame = new Frame("APIC", new byte[] {
                0, 0
            }, null, abyte0, false);
            tag.addTag(frame);
            int i = apictag.getImageOffset();
            Image image = Image.createImage(abyte0, i, abyte0.length - i);
            imageForm.deleteAll();
            StringItem stringitem = new StringItem("New image:", s);
            imageForm.append(stringitem);
            imageForm.append(image);
            ticker.setString("Remember to select Save to edit the art image");
        }
        catch(IOException ioexception)
        {
            logger.log(ioexception.toString());
        }
    }

    private void setupImages()
    {
        try
        {
            Image image = Image.createImage("folder.png");
            Image image1 = Image.createImage("music.png");
            Image image2 = Image.createImage("up.png");
            Image image3 = Image.createImage("image.png");
            fileBrowser.setFileImage(image1);
            fileBrowser.setUpImage(image2);
            fileBrowser.setFolderImage(image);
            imageBrowser.setFileImage(image3);
            imageBrowser.setUpImage(image2);
            imageBrowser.setFolderImage(image);
        }
        catch(Exception exception)
        {
            logger.log(exception.toString());
        }
    }

    private Gauge gauge;
    private Form progressForm;
    private Form tagEditor;
    private Command cmdBrowseFile;
    private Command cmdSaveTags;
    private Command cmdExit;
    private Command cmdAbout;
    private TextField textFieldPath;
    private TextField textFieldTitle;
    private TextField textFieldAlbum;
    private TextField textFieldArtist;
    private TextField textFieldYear;
    private TextField textFieldGenre;
    private Command cmdHelp;
    private Command cmdCancel;
    private Ticker ticker;
    private Tag tag;
    private FileBrowser fileBrowser;
    private FileBrowser imageBrowser;
    private Command replaceArtCommand;
    private Form imageForm;
    private Command showImageCmd;
    private Command backFromImageFormCmd;
    private Logger logger;
    private Command showLogCommand;
    private SettingsForm settingsForm;
    private Preferences pref;
    private Command configureSettingsCmd;
    private Command deleteArtCmd;
}

Archivo 2: Tag.java (Quiero convertirlo a Tag.class)

Código:
package com.gowtham.jmp3tag;

import java.io.*;
import java.util.Vector;
import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;
import javax.microedition.lcdui.Gauge;

// Referenced classes of package com.gowtham.jmp3tag:
//            Frame

public class Tag
{

    public Tag(String s)
    {
        file = s;
        tagExists = false;
        header = new byte[10];
        extendedHeader = new byte[10];
        frames = new Vector();
        tagSizeBuffer = new byte[4];
        padding = 0;
    }

    public void deleteAPICFrame()
    {
        deleteFrame("APIC");
    }

    public String getTitile()
    {
        return title;
    }

    public String getAlbum()
    {
        return album;
    }

    public String getArtist()
    {
        return artist;
    }

    public String getYear()
    {
        return year;
    }

    public String getComment()
    {
        return comment;
    }

    public String getGenre()
    {
        return Genre;
    }

    public boolean tagExists()
    {
        return tagExists;
    }

    public boolean Read()
        throws IOException
    {
        FileConnection fileconnection = (FileConnection)Connector.open(file, 1);
        if(!fileconnection.exists())
            throw new IOException("File " + file + " does not exist!");
        InputStream inputstream = fileconnection.openInputStream();
        int i = inputstream.read(header, 0, 3);
        if(i < 3)
            throw new IOException("Less than 3 bytes read in the first call!");
        String s = new String(header);
        s = s.trim();
        System.out.println("First text = " + s);
        if(s.compareTo("ID3") == 0)
        {
            tagExists = true;
            inputstream.read(header, 3, 7);
            System.out.println("Header = " + new String(header));
            tagSize = calculateTagSize(header, 6, 9);
            System.out.println("Tag size = " + tagSize);
            if((header[5] & 0x40) != 0)
                extendedHeaderExists = true;
            else
                extendedHeaderExists = false;
            System.out.println("Extended header = " + extendedHeaderExists);
            if(extendedHeaderExists)
                inputstream.read(extendedHeader, 0, 10);
            int j = tagSize;
            originalTagSize = j + 10;
            tagData = new byte[j];
            inputstream.read(tagData, 0, j);
            populateTags(tagData, j);
            System.out.println("Title = [" + title + "]");
            System.out.println("Album = [" + album + "]");
            System.out.println("Artist = [" + artist + "]");
        }
        inputstream.close();
        fileconnection.close();
        return true;
    }

    public int calculateTagSize(byte abyte0[], int i, int j)
    {
        int k = 0;
        for(int l = i; l <= j; l++)
        {
            int i1 = abyte0[l];
            i1 &= 0x7f;
            if(l > i)
                k <<= 7;
            k += i1;
        }

        return k;
    }

    public byte[] getFrameData(byte abyte0[], int i, int j)
    {
        int k = j - i;
        byte abyte1[] = new byte[k + 1];
        for(int l = i; l <= j; l++)
            abyte1[l - i] = abyte0[l];

        return abyte1;
    }

    public void populateTags(byte abyte0[], int i)
    {
        int j = 0;
        byte abyte1[] = new byte[4];
        byte abyte3[] = new byte[4];
        byte abyte5[] = new byte[2];
        do
        {
            if(j >= i)
                break;
            byte abyte2[] = getFrameData(abyte0, j + 0, j + 3);
            byte abyte4[] = getFrameData(abyte0, j + 4, j + 7);
            byte abyte6[] = getFrameData(abyte0, j + 8, j + 9);
            String s = new String(abyte2);
            if(!Frame.isValidFrame(s))
            {
                System.out.println("Invalid frame " + s);
                padding += 10;
                j += 10;
                if(i - j < 10)
                    break;
                continue;
            }
            System.out.println("Frame " + abyte2);
            int k = Frame.calculateFrameSize(abyte4, 0, 3);
            System.out.println("Size " + k);
            byte abyte7[] = new byte[k];
            System.out.println("data size = " + abyte0.length);
            System.out.println("i+10 = " + (j + 10));
            System.out.println("i+10+frameSizeInt-1 = " + ((j + 10 + k) - 1));
            abyte7 = getFrameData(abyte0, j + 10, (j + 10 + k) - 1);
            boolean flag = isEditableTag(s);
            String s1;
            if(flag)
            {
                s1 = myBinary2String(abyte7);
                System.out.println(s + " is editable");
            } else
            {
                s1 = new String(abyte7);
                System.out.println(s + " is NOT editable");
            }
            s1 = s1.trim();
            System.out.println("FRAME = " + s + " size " + k + " value " + s1);
            if(s.equalsIgnoreCase("TALB"))
                album = s1;
            else
            if(s.equalsIgnoreCase("TCON"))
                genre = s1;
            else
            if(s.equalsIgnoreCase("TIT2"))
                title = s1;
            else
            if(s.equalsIgnoreCase("TYER"))
                year = s1;
            else
            if(s.equalsIgnoreCase("COMM"))
            {
                if(s1.startsWith("eng"))
                    s1 = s1.substring(s1.indexOf('g') + 1);
                comment = s1;
            } else
            if(s.equalsIgnoreCase("TPE1"))
                artist = s1;
            Frame frame = new Frame(s, abyte6, s1, abyte7, flag);
            frames.addElement(frame);
            j += k + 10;
            if(i - j < 10)
                break;
            System.out.println("i = " + j);
        } while(true);
    }

    public String myBinary2String(byte abyte0[])
    {
        int i = abyte0.length;
        for(int j = 0; j < abyte0.length; j++)
            System.out.println("Data : " + j + " " + abyte0[j]);

        byte abyte1[] = new byte[i];
        int k = 0;
        int l = 0;
        if((abyte0[0] == 1 || abyte0[0] == 0) && (abyte0[1] == -1 && abyte0[2] == -2 || abyte0[1] == -2 && abyte0[2] == -1))
        {
            System.out.println("Unicode");
            l = 3;
        }
        if(abyte0[0] == 0)
        {
            System.out.println("ISO-8859");
            l = 1;
        }
        for(; l < i; l++)
            if(abyte0[l] != 0)
            {
                abyte1[k] = abyte0[l];
                k++;
            }

        return new String(abyte1);
    }

    public void setTitile(String s)
    {
        title = s;
        setFrame("TIT2", title);
    }

    public void setAlbum(String s)
    {
        album = s;
        setFrame("TALB", album);
    }

    public void setArtist(String s)
    {
        artist = s;
        setFrame("TPE1", artist);
    }

    public void setYear(String s)
    {
        year = s;
        setFrame("TYER", year);
    }

    public void setComment(String s)
    {
        byte abyte0[] = new byte[1];
        abyte0[0] = 0;
        comment = s;
        setFrame("COMM", "eng" + new String(abyte0) + comment);
    }

    public void setGenre(String s)
    {
        genre = s;
        setFrame("TCON", genre);
    }

    public boolean Save(Gauge gauge, boolean flag)
        throws IOException
    {
        String s = file;
        int i = file.indexOf('.', 0);
        if(i == -1)
            throw new IOException("File name has no . (dot)");
        s = file.substring(0, i) + "_edited.mp3";
        FileConnection fileconnection = (FileConnection)Connector.open(s, 3);
        if(fileconnection.exists() && !flag)
            throw new IOException("Tags not saved because file " + s + " already exists. Set overwrite mode ON to overwrite existing files");
        if(!fileconnection.exists())
            fileconnection.create();
        FileConnection fileconnection1 = (FileConnection)Connector.open(file, 3);
        OutputStream outputstream = fileconnection.openOutputStream();
        InputStream inputstream = fileconnection1.openInputStream();
        long l = fileconnection1.fileSize();
        System.out.println("complieTag started");
        compileTag();
        System.out.println("complieTag ended");
        if(header[3] < 3)
            header[3] = 3;
        outputstream.write(header, 0, 6);
        outputstream.write(tagSizeBuffer);
        if(extendedHeaderExists)
            outputstream.write(extendedHeader);
        for(int j = 0; j < frames.size(); j++)
        {
            System.out.println("Writing frame " + j);
            Frame frame = (Frame)frames.elementAt(j);
            outputstream.write(frame.serialize());
        }

        for(int k = 0; k < padding; k++)
            outputstream.write(0);

        long l1 = l;
        if(tagExists)
        {
            long l2 = inputstream.skip(originalTagSize);
            if(l2 < originalTagSize)
            {
                long l4 = inputstream.skip(originalTagSize - l2);
                l2 += l4;
            }
            l1 -= originalTagSize;
        }
        long l3 = 0L;
        boolean flag1 = true;
        char c = '\u1000';
        int i1;
        do
        {
            byte abyte0[] = new byte[c];
            i1 = inputstream.read(abyte0, 0, c);
            l3 += i1;
            int j1 = (int)(((float)l3 / (float)l) * 100F);
            System.out.println("Percentage " + j1);
            gauge.setValue(j1);
            System.out.println("Read = " + i1 + " " + "Buffer " + abyte0.length + " " + l3 + "/" + l);
            if(i1 != -1)
                if(i1 < c)
                {
                    System.out.println("Read < size " + i1 + " " + (int)c);
                    for(int k1 = 0; k1 < i1; k1++)
                        outputstream.write(abyte0[k1]);

                } else
                {
                    outputstream.write(abyte0, 0, i1);
                }
        } while(i1 != -1);
        inputstream.close();
        outputstream.close();
        System.out.println("Output size " + fileconnection.fileSize());
        fileconnection1.delete();
        fileconnection1.close();
        String s1 = file.substring(file.lastIndexOf('/') + 1);
        System.out.println("Base = " + s1);
        fileconnection.rename(s1);
        fileconnection.close();
        return true;
    }

    public void compileTag()
    {
        if(!tagExists())
        {
            header[0] = 73;
            header[1] = 68;
            header[2] = 51;
            header[3] = 3;
            header[4] = 0;
            header[5] = 0;
            extendedHeaderExists = false;
        }
        System.out.println("calculateNewTagSize() started");
        tagSize = calculateNewTagSize();
        System.out.println("calculateNewTagSize() done");
        System.out.println("getTagSizeBuffer() started");
        tagSizeBuffer = getTagSizeBuffer(tagSize);
        System.out.println("getTagSizeBuffer() done");
    }

    private byte[] getTagSizeBuffer(int i)
    {
        byte abyte0[] = new byte[4];
        int j = 0;
        System.out.println("X = " + i);
        for(; j < 4; j++)
        {
            byte byte0 = (byte)(i & 0x7f);
            System.out.println(byte0);
            abyte0[3 - j] = byte0;
            i >>= 7;
        }

        return abyte0;
    }

    private boolean deleteFrame(String s)
    {
        boolean flag = false;
        for(int i = 0; i < frames.size(); i++)
        {
            Frame frame = (Frame)frames.elementAt(i);
            if(frame.getFrameID().equalsIgnoreCase(s))
            {
                flag = true;
                frames.removeElement(frame);
            }
        }

        return flag;
    }

    private int calculateNewTagSize()
    {
        int i = 0;
        for(int j = 0; j < frames.size(); j++)
        {
            Frame frame = (Frame)frames.elementAt(j);
            int k = frame.getFrameSize() + 10;
            String s = frame.getFrameID();
            System.out.println("Frame " + s + " size = " + k);
            i += k;
        }

        System.out.println("Padding " + padding);
        i += padding;
        System.out.println("New tagsize = " + i);
        return i;
    }

    private void setFrame(String s, String s1)
    {
        int i = 0;
        boolean flag = false;
        do
        {
            if(i >= frames.size())
                break;
            Frame frame = (Frame)frames.elementAt(i);
            if(frame.getFrameID().compareTo(s) == 0)
            {
                frame.setData(s1);
                flag = true;
                break;
            }
            i++;
        } while(true);
        if(!flag)
        {
            byte abyte0[] = new byte[2];
            abyte0[0] = 0;
            abyte0[1] = 0;
            Frame frame1 = new Frame(s, abyte0, s1, null, true);
            frames.addElement(frame1);
        }
    }

    private boolean isEditableTag(String s)
    {
        Vector vector = new Vector();
        vector.addElement(new String("TALB"));
        vector.addElement(new String("TCON"));
        vector.addElement(new String("COMM"));
        vector.addElement(new String("TIT2"));
        vector.addElement(new String("TPE1"));
        vector.addElement(new String("TYER"));
        for(int i = 0; i < vector.size(); i++)
        {
            String s1 = (String)vector.elementAt(i);
            if(s1.compareTo(s) == 0)
                return true;
        }

        return false;
    }

    public byte[] getFrame(String s)
    {
        for(int i = 0; i < frames.size(); i++)
        {
            Frame frame = (Frame)frames.elementAt(i);
            if(frame.getFrameID().compareTo(s) == 0)
                return frame.getBytes();
        }

        return null;
    }

    public void addTag(Frame frame)
    {
        frames.addElement(frame);
    }

    private String file;
    private String title;
    private String album;
    private String artist;
    private String year;
    private String comment;
    private String genre;
    private boolean tagExists;
    private boolean extendedHeaderExists;
    private int tagSize;
    private long originalTagSize;
    private byte header[];
    private byte extendedHeader[];
    private byte tagData[];
    private Vector frames;
    private byte tagSizeBuffer[];
    private int padding;
}

Agradesco de antemano su valiosa aportación a mi duda y/o petición...

Gracias...


...
 
Por el mensaje de error, no tienes instalado el compilador para J2ME que es la edición para desarrollo para equipos móviles, léase celulares y similares.

Tienes que instalarlo para poder compilar ese código fuente. Supongo que la IDE que utilizas o el compilador requerirán que configures la ruta donde encontrará las librerías de la J2ME... eso ya lo verificas en la documentación correspondiente.
 
Gracias por la respuesta Zephyros, buscare algo de información acerca de lo que me dices.
 
Volver
Arriba