• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

replace import com.sun.xml.messaging.saaj.util.ByteOutputStream; with alternative

 
Ranch Hand
Posts: 1283
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi in jasper report to generate report I am using ByteOutputStream by importing jar-> import com.sun.xml.messaging.saaj.util.ByteOutputStream; and using below code for same, but for some reasons I am not able to use this jar, please suggest me equivalent alternative for same. Thanks



 
Sheriff
Posts: 21842
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried java.io.ByteArrayOutputStream? You can get the bytes using toByteArray(), and if you need an input stream for those you can use java.io.ByteArrayInputStream.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never use classes from com.sun.* or sun.* packages directly in your code. These packages are internal packages in the JDK; they are not part of Java's standard library, and they can change in any new Java version. If you use classes from these packages, your code might be incompatible with future Java versions.

In fact, I think that in Java 8 a new mechanism was added that prevents you from using these packages in your code. If you do it, you will get an error when you run your program.
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. You are the real hero
 
Are you here to take over the surface world? Because this tiny ad will stop you!
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!