Class JsonProductSource

java.lang.Object
gov.usgs.earthquake.product.io.JsonProductSource
All Implemented Interfaces:
ProductSource

public class JsonProductSource extends Object implements ProductSource
Load a product from an InputStream containing Json.
  • Constructor Details

    • JsonProductSource

      public JsonProductSource(InputStream in)
      Create a new JsonProductSource.
      Parameters:
      in - the input stream where Json is read.
  • Method Details

    • streamTo

      public void streamTo(ProductHandler out) throws Exception
      Begin reading the input stream, sending events to out.
      Specified by:
      streamTo in interface ProductSource
      Parameters:
      out - the receiving ProductOutput.
      Throws:
      Exception - if error occurs
    • close

      public void close()
      Free any resources associated with this handler.
      Specified by:
      close in interface ProductSource