Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help with ImageInputStream types

 
guillermo urdaneta
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic