Class ByteArrayPayload

java.lang.Object
com.cloudinary.android.payload.Payload<byte[]>
com.cloudinary.android.payload.ByteArrayPayload

public class ByteArrayPayload
extends Payload<byte[]>
This class is used to handle uploading of images/videos as byte arrays
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String ENCODING_CHARSET  

    Fields inherited from class com.cloudinary.android.payload.Payload

    data
  • Constructor Summary

    Constructors 
    Constructor Description
    ByteArrayPayload()  
    ByteArrayPayload​(byte[] data)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    long getLength​(android.content.Context context)
    Get the length of the resource in bytes
    int hashCode()  
    java.lang.Object prepare​(android.content.Context context)
    Prepares the payload to upload to Cloudinary
    java.lang.String toUri()
    Constructs a uri of the data to upload, for serialization.

    Methods inherited from class com.cloudinary.android.payload.Payload

    getData

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • toUri

      public java.lang.String toUri()
      Description copied from class: Payload
      Constructs a uri of the data to upload, for serialization.
      Specified by:
      toUri in class Payload<byte[]>
      Returns:
      The string representation of the uri.
    • getLength

      public long getLength​(android.content.Context context)
      Description copied from class: Payload
      Get the length of the resource in bytes
      Specified by:
      getLength in class Payload<byte[]>
      Parameters:
      context - Android context.
      Returns:
      The length
    • prepare

      public java.lang.Object prepare​(android.content.Context context) throws EmptyByteArrayException
      Description copied from class: Payload
      Prepares the payload to upload to Cloudinary
      Specified by:
      prepare in class Payload<byte[]>
      Parameters:
      context - Android context
      Returns:
      An object formatted for Cloudinary uploader. This can be one of InputStream, Byte array, File object or an absolute path (as string).
      Throws:
      EmptyByteArrayException
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class Payload<byte[]>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Payload<byte[]>