Class MemoryResource

  • All Implemented Interfaces:
    Resource, java.lang.AutoCloseable

    public class MemoryResource
    extends java.lang.Object
    implements Resource
    Memory resource. This class can be used for writing to memory instead of a file.
    See Also:
    FileResource
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoryResource()  
    • Method Summary

      Modifier and Type Method Description
      java.lang.String asString()  
      void close()  
      java.io.PrintWriter open()
      Opens this resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MemoryResource

        public MemoryResource()
    • Method Detail

      • open

        public java.io.PrintWriter open()
                                 throws java.io.IOException
        Description copied from interface: Resource
        Opens this resource.
        Specified by:
        open in interface Resource
        Returns:
        print writer for writing to this resource.
        Throws:
        java.io.IOException - if an I/O related problem prevents this operation
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Resource
        Throws:
        java.io.IOException
      • asString

        public java.lang.String asString()