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 
    Wraps a byte[] array as a Data object.
    static class 
    Wraps a File as a Data object.
    static class 
    Wraps a Storage object as a Data object.
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the data's content to an output stream.
    long
    Gets the size of the data content.
  • Method Details

    • appendTo

      void appendTo(OutputStream output) throws IOException

      Appends the data's content to an output stream.

      Parameters
      • output: The output stream to append to.
      Throws
      • IOException
      Throws:
      IOException
    • getSize

      long getSize() throws IOException

      Gets the size of the data content.

      Returns

      Size of content in bytes.

      Throws
      • IOException
      Throws:
      IOException