Can you convert from Writer stream to String ?

Hi all !
I'd like to know if it's possible to convert a Writer stream to a String Object....
FileWriter writer = new FileWriter("book.xml");
Marshaller.marshal(book, writer); // I would need to convert writer to StringI've inspected the StringWriter class but I couldn't still get anything from it.....
any clue ?
thanks a lot
francesco

What do you mean that you couldn't get anything out of StringWriter? What was wrong with "toString()"?
Another way would be to wrap an OutputStreamWriter around a ByteArrayOutputStream then create a String with the byte array backing the ByteArrayOutputStream.
The real question, however, is why?
Edit: Man-o-man-o-man am I slow today, or what? And didn't this guy get jumped on quickly. ;-)

Similar Messages

  • HT4437 Can you use airplay to stream from an iPad to a TV with a network connection without internet access

    Can you use airplay to stream from an iPad to a TV with a network connection without internet access

    Yes, you can use a network storage device for the storage of your content and use it on the Apple TV, but only as part of your iTunes library. So if your question is whether or not you can do this without using your computer or iTunes the answer is no.

  • Can you convert a favourites file from windows to a bookmark file for mac?

    can you convert a favourites file from windows to a bookmark file for mac?

    I can't answer for Internet Explorer but you should be able to export Bookmarks from FireFox. If you can't export from IE you may be able to import from EI to FireFox first.
    In FireFox, menu BookMarks>Organize Bookmarks, then in the pane which opens, menu File>Export (that's how it works on Linux so Windows should be broadly similar). The result should be an html file.
    You may be able to import this into Safari on your Mac; certainly you should be able to import it into FireFox and perhaps from there to Safari if necessary.

  • Gdk-WARNING **: Error converting from UTF-8 to STRING

    I just installed Arch64 few days ago. In my old setup I was used to work with 2 softwares: Eclipse CDT and WingIDE.
    I tried to start these applications (they require java and python but they are binary releases) locally and I get this errors which I can't solve by myself googling... Reporting snapshots of my desktop too.
    [j_zar@Surprise eclipse]$ ./eclipse
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: Impossibile aprire il convertitore da "UTF-8" a "ISO-8859-1"
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: Failed to load Pango module '/usr/lib/pango/1.6.0/modules/pango-basic-fc.so' for id 'BasicScriptEngineFc'
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: pango_shape called with bad font, expect ugly output
    (eclipse:7864): Pango-WARNING **: pango_font_get_glyph_extents called with null font argument, expect ugly output
    (eclipse:7864): Pango-WARNING **: pango_font_get_metrics called with null font argument, expect ugly output
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Gdk-WARNING **: Error converting from UTF-8 to STRING: La conversione del set di caratteri da "UTF-8" a "ISO-8859-1" non è supportata
    (eclipse:7864): Pango-WARNING **: pango_cairo_font_get_scaled_font called with bad font, expect ugly output
    [j_zar@Surprise wingide]$ ./wing
    (wing.py:7922): Gdk-WARNING **: Error converting from UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1'
    (wing.py:7922): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported
    Anybody can help in this???
    Last edited by J_Zar (2007-10-30 11:48:28)

    There has been talk about adding these config files, that fixes this kinda problems, to a separate pkg with a helper script you run 32bit programs with.
    for quick fix
    Link
    Grab the 3 pango files, throw them somewhere, edit pangorc to corresponding paths for the 2 other files.
    Start program with
    export PANGO_RC_FILE="/path/to/pangorc"
    program
    for the string error, if its iconv
    export GCONV_PATH=/opt/lib32/usr/lib/gconv
    to previous command
    Note, you cant start 64bit programs that use pango/iconv from the terminal you exported the variable.

  • VS_BROKEN CAN NOT CONVERT UNICODE TO NON UNICODE STRING

    Hi,
    I am importing data from orcle to sql through etl if i run it manually it works fine but when i am scheduling in sql agent job it throws VS_BROKEN CAN NOT CONVERT UNICODE TO NON UNICODE STRING error like this
    please any body help me how to solve this.
    Thanks,
    Khasim

    Hi Khasim,
    As per my understanding, the error message is too general. In order to troubleshoot this issue, we should view the detail error message about this job. For more details, please see:
    Troubleshooting Jobs
    SQL Server Agent Error Log
    Besides, since when you call a Microsoft SQL Server Integration Services (SSIS) package outside a SQL Server Agent job step, the SSIS package runs successfully. However, if you do not modify the SSIS package, then execute it via SQL Server Agent job step,
    it fails. The scenario always related to the user account that is used to run the package under SQL Server Agent.
    References:
    SSIS package does not run when called from a SQL Server Agent job step
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Apple TV + Airport Express can you have two separate streams?

    Can you run two separate streams using an AE to a stereo and ATV2 to a separate TV/stereo combo?

    CaptFred,
    Thanks. This is what I just figured out. I can't send two separate streams via remote or direct off the main computer (iMac). However, with the iMac streaming to Computer, AE, & ATV2 . . . I can pull home Home Sharing of the iMac from the MBP. If I select the already active AE speakers, the MBP tries to connect and says they are in use. When I select the AE speakers from the iPhone remote and turn them off (via remote) I can then select them from the MMP and stream different music to the AE (the other iMac originated stream continues uninterrupted).
    Thanks again for kick to go try it .

  • Can you convert your desktop site plan into the phone & tablet version w/o re-creating the pages?

    Can you convert your desktop site plan into the phone & tablet version without re-creating the landing pages? This seems too extensive to have to re-design each page?

    Cwsnell,
    On your nav bar there is a shorcut to other pages.
    The most effecient way I have found to do this from the phone layout,
    click on the page icon shown above
    type in the name of the page (and select the desktop version as indicated by the icon of the monitor)
    select all on that page (CTRL A / Command A) and copy (CTRL C / Command C)
    revert back to the phone layout page and paste (CTRL V / Command V)
    then resize, delete what you dont need, make any other edits and your done!
    There is not a way to copy a page entirely over.  The mobile version should have less information and less imagery to enable fast load times.
    -SiteSpot

  • Can you convert your text messages to your computer?

    Can you convert your text messages from your phone to your computer?

    Text messages are included with your iPhone's backup, which is updated by iTunes as the first step during the iTunes sync process. There are utilities such as this one that provide for extracting this and other data from your iPhone's backup for access on your computer for reading, printing, archiving, etc.
    http://mobilesyncbrowser.com/
    There are other utilities such as this one which is compatible with a Mac for extracting select data direct from the iPhone.
    http://www.ecamm.com/mac/phoneview/

  • Can you convert a Windows Quickbooks Pro 2011 file to an Ibank file?

    does anyone know if you can you convert a Windows Quickbooks Pro 2011 file to an Ibank file?

    I can't answer for Internet Explorer but you should be able to export Bookmarks from FireFox. If you can't export from IE you may be able to import from EI to FireFox first.
    In FireFox, menu BookMarks>Organize Bookmarks, then in the pane which opens, menu File>Export (that's how it works on Linux so Windows should be broadly similar). The result should be an html file.
    You may be able to import this into Safari on your Mac; certainly you should be able to import it into FireFox and perhaps from there to Safari if necessary.

  • What is the differnce between Blue,Purple and Orange Audio Tracks. Can you convert either to Green Midi Track?

    What is the differnce between Blue,Purple and Orange Audio Tracks. Can you convert either to Green Midi Track?

    Are you asking about Garageband? Your signature also mentions Logic, but I have never worked with that.
    Concerning Garageband:
    Real Instrument regions from your recordings are purple.
    Real Instrument regions from Apple Loops are blue.
    Regions from imported audio files are orange.
    Software Instrument regions from recordings, loops, and imported MIDI files are green.
    So far as I know you can convert software instrument loops to real instrument loops, but not real instrument loops to software instrument loops.

  • HT3702 Can you convert euro iTunes voucher to sterling can anyone help me thanks

    Can you convert euro iTunes voucher to sterling can anyone help me thanks

    All iTunes cards/certificates are country-specific, so they can only be used in the country in which they were issued on accounts based in that country. If the card came from a different country then do you know anybody in that country that you could give or sell it to ?

  • How can I convert an int to a string?

    Hi
    How can I convert an int to a string?
    /ad87geao

    Here is some the code:
    public class GUI
        extends Applet {
      public GUI() { 
        lastValue = 5;
        String temp = Integer.toString(lastValue);
        System.out.println(temp);
        showText(temp);
      private void showText(final String text) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            tArea2.setText(text + "\n");
    }

  • Can you print from an iPad 2 using 3G in a home with no computer or wifi by using an iPhone 5 hot spot connection if the printer has been set up in another place with live wifi? I know this question is loaded but my dad lives in a rural area

    Can you print from an iPad 2 using 3G in a home with no other computer or wifi by using an iPhone 5 hot spot connection if the printer has been set up in another place with live wifi? I know this question is loaded but my dad lives in a rural area and is wanting a printer to use occasionally. He doesn't want to deal with a computer and I keep his iPad updated for him at my home.  Please shed some light on this for us PLEASE. Thanks

    In that case, it should be possible. I haven't tried this directly, but I believe it should work.
    You'll need to get an actual AirPrint compatible Printer.
    Check here for a list of Printers you can choose from.
    http://support.apple.com/kb/ht4356
    Once you have the compatible printer, using the Hotspot feature from the iPhone he'll have to create the Wifi bubble form the iPhone, and connect the Printer to that Wifi network.
    Then connect the iPad to that same Wifi network provided by the iPhone. When all that is done, the printer should appear in any of the Apps that can Print under the Action Arrow button.
    For instance in email, pressing the action arrow should show a Print option. In there the printer should appear.
    Alternatively you can simply buy a wireless router and setup the network through there even if there is no internet attached.  Connect the wireless printer to the router network, and connect the iPad or iPhone to that same wifi network to print.

  • How can I convert  an ArrayList to a String[]

    Hi,
    How can I convert an ArrayList (only with strings) to a String[] ?
    I've tried this :
         public static String listToString(List l) {
              StringBuffer sb = new StringBuffer();
              Iterator iter = l.iterator();
              while (iter.hasNext()) {
                   sb.append(iter.next().toString());
                   if (iter.hasNext()) {
                        sb.append(',');
              return sb.toString();
    But what I get is an array of xxxxx@435634 (for example).
    Thanks a lot !

    Strings are Objects but not all Objects are Strings and at least one of the elements in your List is not a String.

  • How many times can you restore from the same backup?

    how many times can you restore from the same backup?

    As many times as you want till you delete or modify it.
    It's YOUR backup, a copy of all your stuff.
    Not some copyrighted, access controlled bunch of bytes representing a picture, a song or a movie, with a bunch of lawyers from the entertainment maff1a hellbent on restricting what you can do with it.

Maybe you are looking for

  • Help reading a .txt file from the hard drive....

    Hi guys, Ok... I need to know how to read a .txt file from the hard drive... I have an example on how to read from a disk, but I don't have a disk drive. I could be confusing terminology, but I don't think I am. Here is the code I have for reading fr

  • How to transfer an xml file to NW Portal Knowledge Management from XI?

    Hi all, Anybody knows how to transfer an xml file to NW Portal Knowledge Management from XI? What kind of adapter type I have to choose? And which procedures I have to do in KM Portal? Create a folder, what kind of folder and permissions? Suggestions

  • IDOC to JDBC

    HI All, I am working on IDOC to JDBC scenario. Everything is going correct In Pipeline steps. But in whenever I am sending IDOC frm R3 to XI message getting stuck in SMQ2 . for this I have checked after the mapping Excuetion if I am sending the 5000

  • One schema for OWB Design repository, runtime repository

    Can we use only one schema for the design and runtime repositories on the same database instance and leave the target schemas separate? What are the advantages and disadvantages of this approach? Thanks a lot for your time and reply.

  • Help! PS Elements 12 user interface is so small it's almost unusable...

    My editing options, etc are WAY too small!!!! Can someone PLEASE tell me how I can change the view? If I uninstall and then select custom install when re-downloading, can I select to download the program in a larger format? I'm using Photoshop Elemen