cdac.medinfo.sdk.hl7282.commoninterface

## Interface IHL7Stream

- All Known Implementing Classes:
    HL7BufferStream, HL7FileStream, HL7Stream

      public interface IHL7Stream

  Declares all the methods Used for the HL7 stream. IHL7Stream is Input/Output operation interface used for message parsing & serialization. It provides with method that read/write primitive data types.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()` Returns available number of Bytes in IHL7Stream.
    `boolean` | `endSend()` Checks end of Stream.
    `int` | `getReadBytes()` Tracks bytes read from the stream.
    `int` | `getStream()` Returns the stream type to which it is set to [InputStream/outputStream].
    `int` | `mark(int iReadAheadLimit)` Marks Stream with Read Ahead Limit specified.
    `int` | `readBuffer(byte[] arrbyte)` Reads buffer byte by byte from stream.
    `byte` | `readByte()` Reads a single byte from the stream.
    `char` | `readChar()` Reads a char from the stream.
    `int` | `readString(java.lang.StringBuffer strBuffValue, int iCount)` Reads a string from the stream with specified length.
    `int` | `reset()` Resets the Stream to previously marked position.
    `boolean` | `startReceive()` Checks receiving of Stream.
    `int` | `writeBuffer(byte[] arrbyte, int iOffset, int iLength)` Writes Byte array to the DataOutputStream.
    `int` | `writeByte(byte byteVal)` Writes a byte on the stream.
    `int` | `writeChar(char charVal)` Writes a character with specified endianNess to the stream.
    `int` | `writeString(java.lang.String strValue)` Writes the string specified in the parameter to the stream.

- - ### Method Detail

    - #### getStream

          int getStream()

      Returns the stream type to which it is set to [InputStream/outputStream].
      Returns:
        int - returns the stream type which is being used

    - #### getReadBytes

          int getReadBytes()

      Tracks bytes read from the stream.
      Returns:
        int - the total no of bytes read

    - #### readByte

          byte readByte()

      Reads a single byte from the stream.
      Returns:
        int - returns the byte read

    - #### readChar

          char readChar()

      Reads a char from the stream.
      Returns:
        int - returns the character which is read

    - #### readString

          int readString(java.lang.StringBuffer strBuffValue,
                       int iCount)

      Reads a string from the stream with specified length.
      Parameters:
        `iCount` - length of the string to be read
        `strBuffValue` - String buffer holds the data read
      Returns:
        String - the read string

    - #### writeString

          int writeString(java.lang.String strValue)

      Writes the string specified in the parameter to the stream.
      Parameters:
        `strValue` - the String to write
      Returns:
        int - Success\Fail

    - #### readBuffer

          int readBuffer(byte[] arrbyte)

      Reads buffer byte by byte from stream.
      Parameters:
        `arrbyte` - byte to read
      Returns:
        iNumberOfBytesRead - Returns the number of bytes actually read from input stream
        If no byte is available because the stream is at end of file, the value -1 is returned

    - #### writeByte

          int writeByte(byte byteVal)

      Writes a byte on the stream.
      Parameters:
        `byteVal` - byte to write
      Returns:
        int - Success\Fail

    - #### writeChar

          int writeChar(char charVal)

      Writes a character with specified endianNess to the stream.
      Parameters:
        `charVal` - character to write
      Returns:
        int - Success\Fail

    - #### writeBuffer

          int writeBuffer(byte[] arrbyte,
                        int iOffset,
                        int iLength)

      Writes Byte array to the DataOutputStream.
      Parameters:
        `arrbyte` - byte array to write
        `iOffset` - the start offset in the data
        `iLength` - the number of bytes to write
      Returns:
        int - Success\Fail

    - #### startReceive

          boolean startReceive()

      Checks receiving of Stream.
      Returns:
        boolean - true/false

    - #### endSend

          boolean endSend()

      Checks end of Stream.
      Returns:
        boolean - true/false.

    - #### mark

          int mark(int iReadAheadLimit)

      Marks Stream with Read Ahead Limit specified.
      Parameters:
        `iReadAheadLimit` - number of streams
      Returns:
        int - number of streams

    - #### reset

          int reset()

      Resets the Stream to previously marked position.
      Returns:
        int - number of streams

    - #### available

          int available()

      Returns available number of Bytes in IHL7Stream.
      Returns:
        int - number of Bytes in HL7 Stream