String or InputStream =>File


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: String or InputStream =>File

  1. #1
    Join Date
    Jul 2004
    Posts
    7

    String or InputStream =>File

    The output of one class is String or InputStream, while the next class only accept File. Of course, I can write the String or InputStream into a temporary file. But, is there any way to translate String or InputStream to File directly without writing a file?

    Thanks a lot!

  2. #2
    Join Date
    May 2004
    Posts
    219
    A File object is representative of an actual file, so it wouldn't make sense to have a File object without a file, would it?

    May I ask what you're attempting to do? It is odd that you would want to create a File, but not a file...

    edit: Oh, what class is this? I guess writing it to a real file would be your only choice if you are using a proprietary class that only takes File..

  3. #3
    Join Date
    Feb 2004
    Posts
    808
    I'm with drain on this one.. perhaps you could tell us which classes are causing your current problem (hence asking us to fix the problem), rather than asking us to fix the "solution" that you propose
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  4. #4
    Join Date
    Jul 2004
    Posts
    7
    All those classes was written by myself. Writing it to a file may be the only solution.

    Anyway, thank you all for your help!

  5. #5
    Join Date
    May 2004
    Posts
    219
    Originally posted by gejianye
    All those classes was written by myself. Writing it to a file may be the only solution.
    Then why not edit the class to accept a String/StringBuffer instead of a File?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center