HeartbeatMessage (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.crypto.tls

## Class HeartbeatMessage

- java.lang.Object
- - org.bouncycastle.crypto.tls.HeartbeatMessage

-     public class HeartbeatMessage
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `paddingLength`
    `protected byte[]` | `payload`
    `protected short` | `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeartbeatMessage(short type, byte[] payload, int paddingLength)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `encode(TlsContext context, java.io.OutputStream output)` Encode this `HeartbeatMessage` to an `OutputStream`.
    `static HeartbeatMessage` | `parse(java.io.InputStream input)` Parse a `HeartbeatMessage` from an `InputStream`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### type

          protected short type

    - #### payload

          protected byte[] payload

    - #### paddingLength

          protected int paddingLength

  - ### Constructor Detail

    - #### HeartbeatMessage

          public HeartbeatMessage(short type,
                          byte[] payload,
                          int paddingLength)

  - ### Method Detail

    - #### encode

          public void encode(TlsContext context,
                    java.io.OutputStream output)
                      throws java.io.IOException

      Encode this `HeartbeatMessage` to an `OutputStream`.
      Parameters:
        `output` - the `OutputStream` to encode to.
      Throws:
        `java.io.IOException`

    - #### parse

          public static HeartbeatMessage parse(java.io.InputStream input)
                                        throws java.io.IOException

      Parse a `HeartbeatMessage` from an `InputStream`.
      Parameters:
        `input` - the `InputStream` to parse from.
      Returns:
        a `HeartbeatMessage` object.
      Throws:
        `java.io.IOException`