File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes need help with ImageInputStream  types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "need help with ImageInputStream  types" Watch "need help with ImageInputStream  types" New topic
Author

need help with ImageInputStream types

guillermo urdaneta
Ranch Hand

Joined: Jun 09, 2007
Posts: 38
This is my code, anyone can help me, because i can not get a value to bufi variable, always is null.

getDocumentByDocHandle25mtemp is byte[]

ByteArrayInputStream bis = new ByteArrayInputStream(getDocumentByDocHandle25mtemp);

Iterator readers = ImageIO.getImageReadersByFormatName("TIF");
javax.imageio.ImageReader reader = (javax.imageio.ImageReader)readers.next();
java.lang.Object source = bis;
javax.imageio.stream.ImageInputStream iis = ImageIO.createImageInputStream(source);

reader.getDefaultReadParam();

File myGifFile = new File("C:/aGifFile.TIF");
java.awt.image.BufferedImage bufi = ImageIO.read(iis);
System.out.println("bufi==>"+bufi);
ImageIO.write(bufi,"TIF",myGifFile);
ImageIO.getReaderMIMETypes();


i think the problem is in iis variable!?

appreciate is someone help me!!!
guillermo urdaneta
Ranch Hand

Joined: Jun 09, 2007
Posts: 38
sorry this is the correct code=>

This is my code, anyone can help me, because i can not get a value to bufi variable, always is null.

getDocumentByDocHandle25mtemp is byte[] type.

ByteArrayInputStream bis = new ByteArrayInputStream(getDocumentByDocHandle25mtemp);

Iterator readers = ImageIO.getImageReadersByFormatName("TIF");
javax.imageio.ImageReader reader = (javax.imageio.ImageReader)readers.next();
java.lang.Object source = bis;
javax.imageio.stream.ImageInputStream iis = ImageIO.createImageInputStream(source);

File myGifFile = new File("C:/aGifFile.TIF");
java.awt.image.BufferedImage bufi = ImageIO.read(iis);
System.out.println("bufi==>"+bufi);
ImageIO.write(bufi,"TIF",myGifFile);
ImageIO.getReaderMIMETypes();


i think the problem is in iis variable!?

appreciate is someone help me!!!
Val�ry Urbain
Greenhorn

Joined: Oct 21, 2007
Posts: 11
Originally posted by guillermo urdaneta:
This is my code, anyone can help me, because i can not get a value to bufi variable, always is null.

getDocumentByDocHandle25mtemp is byte[]



i think the problem is in iis variable!?

appreciate is someone help me!!!


Why do you "think" the problem is 'iis' variable? Why aren't you sure? The code you posted doesn't make any sense.
Describe the problem's symptoms, not your guesses.
Describe the goal, not the step.
TellTheDetails and try to IsolateTheProblem.
guillermo urdaneta
Ranch Hand

Joined: Jun 09, 2007
Posts: 38
if i am sure i did not ask anything.

the question is if someone have any experience with an issue like this, i appreciate the help, and your experience for that.

thanks
gurdaneta
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help with ImageInputStream types