Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8134501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:03:26+00:00 2026-06-06T10:03:26+00:00

Im a getting errors from some code developed in Java that want to use

  • 0

Im a getting errors from some code developed in Java that want to use in Android.

ImageIO.write(input, file, cos)

These are my errors for the following code in android, the code works in Java:
BufferedImage cannot be resolved to a type
ImageIO cannot be resolved

 public void decryptFile(String key, String typeFile) throws InvalidKeyException, 
                                                          NoSuchAlgorithmException, 
                                                       InvalidKeySpecException, 
                                                            NoSuchPaddingException, 
                                                                       IOException
   {

       DESKeySpec dks = new DESKeySpec(key.getBytes());
       SecretKeyFactory skf = SecretKeyFactory.getInstance("DES");
       SecretKey desKey = skf.generateSecret(dks);
       Cipher pbeCipher = Cipher.getInstance("DES"); // DES/ECB/PKCS5Padding for SunJCE

       pbeCipher.init(Cipher.DECRYPT_MODE, desKey);    


        // Decrypt the ciphertext and then print it out.     
        FileInputStream output = null;

        File encryptedFile = new File(Environment.getExternalStorageDirectory() + "/images/Et1.jpg");   
        File decryptedFile = new File(Environment.getExternalStorageDirectory() + "/images/Dt1.jpg");


        try 
        {

        output = new FileInputStream(encryptedFile);
        } 
        catch (FileNotFoundException e) 
        {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }

    CipherInputStream cis = new CipherInputStream(output, pbeCipher);
    BufferedImage input = null;

    try 
    {
        input = ImageIO.read(cis);
    } 
    catch (IOException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    FileOutputStream out = null;

    try 
    {
        out = new FileOutputStream(decryptedFile);
    } 
    catch (FileNotFoundException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    try 
    {
        ImageIO.write(input,typeFile, out);
    } 
    catch (IOException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    try 
    {
        cis.close();
    } 
    catch (IOException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }


   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:03:30+00:00Added an answer on June 6, 2026 at 10:03 am

    i had similar problems with

    import javax.sound.sampled.*;
    

    You need to find the corresponding import (probably ImageIO)
    and find a replacement
    for me it was

    import android.media.AudioFormat;
    import android.media.AudioRecord;
    import android.media.MediaRecorder;
    

    if thats not the case then post your errors.
    Also take in mind it wasnt just a matter of switching the import, i had to port the code to the new library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting 21002 'java.lang.NullPointerException' errors from Apple when I try to test my
I recently got an email from a customer saying that they were getting errors
I was running some code & I wasn't getting any errors, but the row
Background: I'm working on some code to read in data from a file. Examples
I have written some code in PHP that returns the html content from .edu
I am getting 403 Errors from Apache when I send too many, 12, synchronous
I've been getting these errors intermittently from sending email from my django app. I
I'm converting a project from vs2008 to vs2010 and getting linker errors for std:ifstream/ofstream
I'm getting reports from my website of weird Javascript errors in a piece of
I have some python code for Google App Engine that responds with the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.