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

  • SEARCH
  • Home
  • 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 871003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:34:19+00:00 2026-05-15T10:34:19+00:00

I am a .NET Developer, but the question I am having is not related

  • 0

I am a .NET Developer, but the question I am having is not related to .NET
Please keep this in mind even if my question sounds very trivial.

This is my question:

We have an swf in the browser, which communicates with a java extension
Its done using Smartfox Server(Used for MMO apllications)

From the swf we are grabbing a portion of the screen as “Byte Array” in action script(3).
And in Java, we are calling a function that converts the ByteArray to Image and then saves it.

Our Java developer is encountering the error

java.lang.illegalArgumentException

when the java function executes.

So basically, what I would like to know is this:

How to accept the object type Byte Array from ActionScript in Java?
Whats Java object type that is mapped to Byte Array in ActionScript?
The conversion part is easy, I dare say.

Update:

The code in the ActionScript Section

public function savePhoto(uName:String, ba:ByteArray, descr:String):void{
    var obj:Object = {};
    obj.arr = ba;
    obj.desc = descr;
    sfsConnectobj.photoSectionSave(obj,"save");
}

public function photoSectionSave(targetObject:Object,type:String) {
    sfs.sendXtMessage("trialjava", "save", targetObject);
}

The first function calls the SmartFox Extension in Java.
The extension name is “trialjava.js”

The Java Code that accepts the function is

public void handleRequest(String cmd, ActionscriptObject ao, User u, int fromRoom)
{
    try {
        ActionscriptObject arr = ao.getObj("arr");
        String dirName="C:\\";
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            ObjectOutputStream oos;
            oos = new ObjectOutputStream(bos);
            oos.writeObject(ao.getObj("arr"));
            oos.flush();
            oos.close();
            bos.close();
            byte [] data = bos.toByteArray();
            BufferedImage imag=ImageIO.read(new ByteArrayInputStream(data));
            ImageIO.write(imag, "jpg", new File(dirName,"snap.jpg"));

    } 
    catch (IOException e) {
        // TODO Auto-generated catch block
        System.out.println("Array reading not succesful. Error is: "+e);
    }
}

Seems like there was a small mismatch in retrieving the objects by java.

Now the error is different.

Array reading not succesful. Error is:
java.io.NotSerializableException:
it.goto
andplay.smartfoxserver.lib.ActionscriptObject

Regards,
naveenj

  • 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-05-15T10:34:20+00:00Added an answer on May 15, 2026 at 10:34 am

    flash.utils.ByteArray is mapped to Java’s byte[] type.

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

Sidebar

Related Questions

This is probably a simple question but I am not an ASP.NET developer and
I'm currently a .NET developer, but I'm starting to work with Flex a little
I have been a VB.net developer for a few years now but I am
I develop asp.net websites, and I read about cloud computing, windows azure, etc. But
I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but
I'm an ASP.NET developer who has used Microsoft SQL Server for all my database
I am primarily a .NET developer, and in that sphere alone there are at
As a .NET developer I'm asking whether JBoss alternatives exist to be more suitable
I am a .Net developer that has been tasked with upgrading a classic asp
I'm a .Net developer and want to get into developing Silverlight applications. I have

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.