• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Weird behaviour with Readers and Writers

 
Ranch Hand
Posts: 680
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am converting a String into a reader and writing that read to a Writer.
But when I declare my writer it seems to empty my read String.

Is there a problem of writers intefearing with a reader
When declaring a writer and reader is tthere anything else I should do.

Any help much appreciated.



[ ejfh: added code tags. ]
[ January 10, 2005: Message edited by: Ernest Friedman-Hill ]
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't figure out what you're trying to do here. I imagine some of this code is "testing" code, but still, I don't see the point. In any case, maybe you could explain your observations: i.e., what you expected to see, and what you see instead. Not what you think you're seeing, but what you actually, physically see on your monitor.

Note that there's a class "StringReader" which provides a Reader interface based on the data in a String. If you used StringReader, you wouldn't have to call getBytes(), or use ByteArrayInputStream or InputStreamReader; your code would be a little cleaner.
 
Tony Evans
Ranch Hand
Posts: 680
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ernest,

Further investigation has shown that it is a JDBC error when trying to get a writer from a CLOB.

Will post new thread on the JDBC thread.

Thanks Tony
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic