Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » IFile.setContents and StringReader
IFile.setContents and StringReader [message #301111] Thu, 23 March 2006 16:32 Go to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

I want to load the contents of a file IFile#create or IFile#setContents from a String. The only way to do this is by using StringBufferInputStream(string) as the InputStream. But StringBufferInputStream is Deprecated and the suggested replacement is StringReader but this won't work with setContent of create.

Any suggestions? or is this a bug?
Re: IFile.setContents and StringReader [message #301166 is a reply to message #301111] Fri, 24 March 2006 07:41 Go to previous messageGo to next message
Eclipse UserFriend
I thought you could use one of the stream-reader bridge classes, but I'm
not sure about that.

Another option is to create a ByteArrayInputStream from your string ...

Later,
PW
Re: IFile.setContents and StringReader [message #301236 is a reply to message #301166] Fri, 24 March 2006 21:34 Go to previous message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Thanks for the suggestion. The stream-reader bridge classes seem to work the other way to change streams to readers.

But the use of ByteArrayInputStream looks like the way to go after converting the string using String#getBytes(). I know my String is all UTF-8 standard latin alphabet.
Previous Topic:Trouble with Help
Next Topic:Can Eclipse automatically arrange functions by alphabet?
Goto Forum:
  


Current Time: Fri May 09 00:10:39 EDT 2025

Powered by FUDForum. Page generated in 0.03824 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top