Class AbstractIOKit<T>

All Implemented Interfaces:
PropertyBindable, PropertyConstrainable, IOKit<T>, URIAccessible, URIInputStreamable, URIOutputStreamable
Direct Known Subclasses:
TextIOKit

public abstract class AbstractIOKit<T> extends DefaultURIAccessible implements IOKit<T>
Deprecated.
Abstract implementation of reading and writing functionality for an object.
Author:
Garret Wilson
  • Constructor Details

    • AbstractIOKit

      public AbstractIOKit()
      Deprecated.
      Default constructor.
    • AbstractIOKit

      public AbstractIOKit(URIInputStreamable uriInputStreamable)
      Deprecated.
      URI input stream locator constructor.
      Parameters:
      uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
    • AbstractIOKit

      public AbstractIOKit(URIOutputStreamable uriOutputStreamable)
      Deprecated.
      URI output stream locator constructor.
      Parameters:
      uriOutputStreamable - The implementation to use for accessing a URI for output, or null if the default implementation should be used.
    • AbstractIOKit

      public AbstractIOKit(URIInputStreamable uriInputStreamable, URIOutputStreamable uriOutputStreamable)
      Deprecated.
      Full constructor.
      Parameters:
      uriInputStreamable - The implementation to use for accessing a URI for input, or null if the default implementation should be used.
      uriOutputStreamable - The implementation to use for accessing a URI for output, or null if the default implementation should be used.
  • Method Details

    • load

      public T load(URI uri) throws IOException
      Deprecated.
      Loads an object from given URI.

      This version opens a stream and delegates to load(InputStream, URI).

      Specified by:
      load in interface IOKit<T>
      Parameters:
      uri - The URI that identifies the resource to be loaded.
      Returns:
      An object containing the data of the resouce represented by the URI.
      Throws:
      IOException - Thrown if there is an error reading the object.
    • save

      public void save(T object, URI uri) throws IOException
      Deprecated.
      Saves an object to a given URI.

      This version opens a stream and delegates to save(T, OutputStream).

      Specified by:
      save in interface IOKit<T>
      Parameters:
      object - The object the data of which will be saved at the given URI.
      uri - The URI at which the object should be saved.
      Throws:
      IOException - Thrown if there is an error writing the object.