Class Data.ByteData

java.lang.Object
com.codename1.io.Data.ByteData
All Implemented Interfaces:
Data
Enclosing interface:
Data

public static class Data.ByteData extends java.lang.Object implements Data

Wraps a byte[] array as a Data object.

Since

7.0

  • Nested Class Summary

    Nested classes/interfaces inherited from interface Data

    Data.ByteData, Data.FileData, Data.StorageData, Data.StringData
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteData(byte[] bytes)
    Creates a new Data object that wraps a byte array.
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteData

      public ByteData(byte[] bytes)

      Creates a new Data object that wraps a byte array.

      Parameters
      • bytes
  • Method Details

    • appendTo

      public 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
      Specified by:
      appendTo in interface Data
      Throws:
      java.io.IOException
    • getSize

      public long getSize() throws java.io.IOException

      Gets the size of the data content.

      Returns

      Size of content in bytes.

      Throws
      • IOException
      Specified by:
      getSize in interface Data
      Throws:
      java.io.IOException