com.ibm.cics.jcicsx

Interface ReadableBITContainer

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method and Description
      default java.io.InputStream asInputStream(int bufferSize)
      Get the content of this CICS Container as an InputStream.
      byte[] get()
      Read the contents of this container as a byte[]
      default <T> T getWith(Deserializer<T> deserializer)
      Read the content of the container into an object of type T, using the provided Deserializer.
      default <T> T getWith(Deserializer<T> deserializer, int chunkSize)
      Read the content of the container into an object of type T, using the provided Deserializer.
      default int read(byte[] into)
      Read the contents of the CICS Container into an application supplied byte[].
      int read(byte[] into, int destOff, int srcOff, int length)
      Read part of the contents of the CICS Container into part of an application supplied byte[]
      default <T> ReadableContainer<T> with(Deserializer<T> deserializer)
      Return a container that wraps this container and allows objects of type T to be retrieved from it directly.
      default <T> ReadableContainer<T> with(Deserializer<T> deserializer, int chunkSize)
      Return a container that wraps this container and allows objects of type T to be retrieved from it directly.
    • Method Detail

      • read

        int read(byte[] into,
                 int destOff,
                 int srcOff,
                 int length)
          throws CICSConditionException
        Read part of the contents of the CICS Container into part of an application supplied byte[]

        EXEC CICS API commands:

        • EXEC CICS GET CONTAINER
        Parameters:
        into - a byte[] in which to store the Container data
        destOff - the offset within the destination byte[] at which to start writing data
        srcOff - the offset within the source Container from which to start reading data
        length - the maximum length of data to read in bytes
        Returns:
        the length of data read in bytes
        Throws:
        CICSConditionException - if there is a problem getting the data from CICS

        RespCodes:

      • asInputStream

        default java.io.InputStream asInputStream(int bufferSize)
        Get the content of this CICS Container as an InputStream. This stream is internally buffered to read data from the CICS container in chunks of bufferSize bytes.
        Parameters:
        bufferSize - how many bytes to read at once
        Returns:
        The InputStream
      • with

        default <T> ReadableContainer<T> with(Deserializer<T> deserializer,
                                              int chunkSize)
        Return a container that wraps this container and allows objects of type T to be retrieved from it directly.

        Objects will be deserialized from the wrapped BIT container using the supplied Deserializer. Some Deserializers are available using static methods on the Deserializers class, or can be custom-written.

        This implementation will load data from the underlying CICS container in chunks of chunkSize. For an implementation that loads all that data from the container at once, see with(Deserializer)

        Type Parameters:
        T - The type that the Deserializer deserializes bytes into
        Parameters:
        chunkSize - How many bytes to load from the CICS container at a time
        deserializer - The Deserializer used to read the content of the container into an object
        Returns:
        A container that can return objects of type T directly
      • with

        default <T> ReadableContainer<T> with(Deserializer<T> deserializer)
        Return a container that wraps this container and allows objects of type T to be retrieved from it directly.

        Objects will be deserialized from the wrapped BIT container using the supplied Deserializer. Some Deserializers are available using static methods on the Deserializers class, or can be custom-written.

        This implementation will load all data from the underlying CICS container at once. For an implementation that loads the data in chunks, see with(Deserializer, int).

        Type Parameters:
        T - The type that the Deserializer deserializes bytes into
        Parameters:
        deserializer - The Deserializer used to read the content of the container into an object
        Returns:
        A container that can return objects of type T directly
      • getWith

        default <T> T getWith(Deserializer<T> deserializer)
                       throws java.io.IOException,
                              CICSConditionException
        Read the content of the container into an object of type T, using the provided Deserializer. This effectively calls with(Deserializer) followed by ReadableContainer.get().

        The object will be deserialized from the wrapped BIT container using the supplied Deserializer. Some Deserializers are available using static methods on the Deserializers class, or can be custom-written.

        This implementation will load all data from the underlying CICS container at once. For an implementation that loads the data in chunks, see getWith(Deserializer, int).

        Type Parameters:
        T - The type that the Deserializer deserializes bytes into
        Parameters:
        deserializer - The Deserializer used to read the content of the container into an object
        Returns:
        The deserialized object
        Throws:
        java.io.IOException - If there is a problem deserializing the data
        CICSConditionException - if there is a problem getting the data from CICS For EXEC CICS and RespCode information see ReadableContainer.get()
      • getWith

        default <T> T getWith(Deserializer<T> deserializer,
                              int chunkSize)
                       throws java.io.IOException,
                              CICSConditionException
        Read the content of the container into an object of type T, using the provided Deserializer. This effectively calls with(Deserializer, int) followed by ReadableContainer.get()

        The object will be deserialized from the wrapped BIT container using the supplied Deserializer. Some Deserializers are available using static methods on the Deserializers class, or can be custom-written.

        This implementation will load data from the underlying CICS container in chunks of chunkSize. For an implementation that loads all that data from the container at once, see getWith(Deserializer)

        Type Parameters:
        T - The type that the Deserializer deserializes bytes into
        Parameters:
        chunkSize - How many bytes to load from the CICS container at a time
        deserializer - The Deserializer used to read the content of the container into an object
        Returns:
        The deserialized object
        Throws:
        java.io.IOException - If there is a problem deserializing the data
        CICSConditionException - if there is a problem getting the data from CICS. For EXEC CICS and RespCode information, see ReadableContainer.get()