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 ClassesModifier and TypeInterfaceDescriptionstatic classWraps a byte[] array as a Data object.static classWraps a File as a Data object.static classWraps a Storage object as a Data object.static class -
Method Summary
Modifier and TypeMethodDescriptionvoidappendTo(OutputStream output) Appends the data's content to an output stream.longgetSize()Gets the size of the data content.
-
Method Details
-
appendTo
Appends the data's content to an output stream.
Parameters
output: The output stream to append to.
Throws
IOException
- Throws:
IOException
-
getSize
Gets the size of the data content.
Returns
Size of content in bytes.
Throws
IOException
- Throws:
IOException
-