public interface Data
Known subtypesData.ByteData, Data.FileData, Data.StorageData, Data.StringData
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 types
class Data.StringData | |
class Data.FileData | Wraps a File as a Data object. |
class Data.StorageData | Wraps a Storage object as a Data object. |
class Data.ByteData | Wraps a byte[] array as a Data object. |
Methods
public abstract void appendTo(OutputStream output)
throws IOException | Appends the data’s content to an output stream. |
public abstract long getSize()
throws IOException | Gets the size of the data content. |
Method details
appendTo
public abstract void appendTo(OutputStream output)
throws IOExceptionAppends the data’s content to an output stream.
Parameters
outputOutputStream- The output stream to append to.
Throws
getSize
public abstract long getSize()
throws IOExceptionGets the size of the data content.
Returns
Size of content in bytes.