This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Object to int array conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Object to int array conversion" Watch "Object to int array conversion" New topic
Author

Object to int array conversion

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
HI,

I just write a int[] in the ObjectOutputStream (In Applet) and I have to receive the same in other end(Servlet) using below code




I tried something but this is wrong. Please advive how to recive the same int [] here



Since this is a General Java query am posting this here
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18101
    
  39

Did you try casting it?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
How ? From Object to int []
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Any array is an object, so yes, casting to int[] is allowed using (int[]).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Object to int array conversion
 
Similar Threads
Data lost when writing object to a file
data lenght mismatch in socket code
Illegal XML character �
servlet to servlet and back??
class invalid for deserialization