Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

addy sharma

Greenhorn
+ Follow
since Apr 17, 2011
addy likes ...
Java Opera Oracle
jaipur,india
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by addy sharma

i have read and noticed that all the SOAP requests are POST request by default.
Why is it POST by default? Is there any disadvantage of using GET in a SOAP request even when i am not sending any parameter to get a resource/response? I am not updating anything.

if possible how can i send SOAP-GET request ?
1 year ago
well thats correct.
The implementing class should "have" all the methods declared in an interface . its not written any where that it should 'implement' all the methods.
Comparator interface is an example  of the same.
Thanks for the clarification 
2 years ago



I have this code where ChildClass implements an interface Demo . the same method signature is used in SuperClass.
This code compiles fine.
Isn't it the breach in the contract of implementing an interface?
even though ChildClass 'has'  doNothing() method but it doesn't implement it for the sake of Interface Contract.
what exactly is happening here.
2 years ago
i would like to correct my code





line number 11,12 compiles but 13 does not compile.
4 years ago
thanks, This is an excellent explaination for Upper bounded wildcard .

Now need some more explaination regarding the lower bounded wildcard.

i have the code fragment.





Now, why compilation fails on line number 11. but it allows me to add bigcats and its subtypes instances to the list.
4 years ago
ok that is fine. brief but nice explanation

List<? extends Object> myList= new ArrayList<String>();
myList = new ArrayList<FooBar>();
myList.add("ASDFG");



but what about the lower bounded wildcard .
here is my code



it fails .why???
4 years ago
this is what i get

"The method add(capture#1-of ? extends Object) in the type List<capture#1-of ? extends Object> is not applicable for the arguments (String)"
4 years ago
i am having following code fragment



this code compiles fine.but when i try to add string object to this list, compilation fails.


so my questions are

1. if this myList is a list that can refer to any ArrayList which extends Object class and according to my code i am assigning the arraylist of string to this reference.then why i can not store the value as string object to it?

2. if compiler doesn't allow to add string object to this list, why does it even allow to refer to the arrayList of string ? this is of no use if i can not add anything to it except null.

3. what is the scope of using this kind of collection objects?
4 years ago
i am calling a method of my applet from within the javascript. My code works fine with all browsers except CHROME.

i get this exception in browser = "Uncaught TypeError: Object #<HTMLObjectElement> has no method 'loadComplete' mainControl.js:6".

i called this method on the "onload" of <body> tag.
4 years ago
i have got the code...here it is!!!

6 years ago
any image can be read through FileInputSteram and the data can be stored in an array of byte.every image contains the header,other information and the image data of its specific type.suppose if we have read the header and after a specific offset in the byte stream ,the image data starts.that image data can be used in drawing images through JFrame.

There is a way to draw that image from that image data without those headers information.it can be done by taking the image data in some DataBufferInt and some of the methods i remember are getRaster().getDataBuffer().with the help of these the image can be generated in a JFrame.
so can you provide me the code to do this task.

@Randall Twede:i want the code to read the data of an image in byte form and then recreate that image with the help of that byte data excluding the header information.
6 years ago
byte rasterdata[]=new byte[br.available()]; //this is the array which has the byte of a bmp image.
br.read(rasterdata,0,(br.available()-1));
ByteArrayInputStream bis= new ByteArrayInputStream(rasterdata);
Iterator<?> readers = ImageIO.getImageReadersByFormatName("bmp");
ImageReader reader = (ImageReader) readers.next();
Object source = bis;
ImageInputStream iis = ImageIO.createImageInputStream(source);
reader.setInput(iis, true);
ImageReadParam param = reader.getDefaultReadParam();
Image image = reader.read(0,param); //and this the place where i am getting the following error



Exception in thread "main" java.lang.IllegalArgumentException: Invalid magic value for BMP file.
at com.sun.imageio.plugins.bmp.BMPImageReader.readHeader(Unknown Source)
at com.sun.imageio.plugins.bmp.BMPImageReader.read(Unknown Source)
at rd.main(rd.java:138)
6 years ago
i have an array of type byte.that array consist of the bytes read from an bmp image file.now how to recreate a bmp image file through that byte array.i have heared that it can be created by using bufferedimage and some other class.provide me the code of recreating the image through an array of byte using bufferedimage class.
6 years ago
well i have made her understand the same thing now..thanks for to all the people who posted reply
7 years ago
yes the same answer i told to the answer seeker....that answer seeker was not satisfied..

and i will remove the duplicate
7 years ago