# Interface Data

All Known Implementing Classes:
  `Data.ByteData, Data.FileData, Data.StorageData, Data.StringData`

public interface Data
An interface that can be implemented by any object to allow it to be treated as data. Data has a size, and can be appended to an OutputStream. It is useful primarily for adding a custom body to a ConnectionRequest.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `Data.ByteData`
  Wraps a byte[] array as a Data object.
  `static class`
  `Data.FileData`
  Wraps a File as a Data object.
  `static class`
  `Data.StorageData`
  Wraps a Storage object as a Data object.
  `static class`
  `Data.StringData`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `appendTo(java.io.OutputStream output)`
  Appends the data's content to an output stream.
  `long`
  `getSize()`
  Gets the size of the data content.

- ## Method Details

  - ### appendTo

    void appendTo(java.io.OutputStream output) throws java.io.IOException

    Appends the data's content to an output stream.

    ###### Parameters

    - `output`: The output stream to append to.

    ###### Throws

    - `IOException`
    Throws:
      `java.io.IOException`

  - ### getSize

    long getSize() throws java.io.IOException

    Gets the size of the data content.

    ###### Returns

    Size of content in bytes.

    ###### Throws

    - `IOException`
    Throws:
      `java.io.IOException`