1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.resource.cci;
  6. import java.io.InputStream;
  7. import java.io.OutputStream;
  8. import java.io.IOException;
  9. /** Streamable interface enables a resource adapter to extract data from
  10. * an input Record or set data into an output Record as a stream of
  11. * bytes.
  12. *
  13. * <p>The Streamable interface provides a resource adapter's view
  14. * of the data that has been set in a Record instance by a component.
  15. *
  16. * <p>The Streamable interface is not directly used by a component. It
  17. * is used by a resource adapter implementation. A component uses Record
  18. * or any derived interfaces to manage records.
  19. *
  20. * @author Rahul Sharma
  21. * @since 0.8
  22. * @see javax.resource.cci.Record
  23. **/
  24. public interface Streamable {
  25. /** Read data from an InputStream and initialize fields of a
  26. * Streamable object.
  27. *
  28. * @param istream InputStream that represents a resource
  29. * adapter specific internal representation
  30. * of fields of a Streamable object
  31. **/
  32. public
  33. void read(InputStream istream) throws IOException;
  34. /** Write fields of a Streamable object to an OutputStream
  35. * @param ostream OutputStream that holds value of a
  36. * Streamable object
  37. **/
  38. public
  39. void write(OutputStream ostream) throws IOException;
  40. }