Class Data.FileData

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

public static class Data.FileData extends Object implements Data

Wraps a File as a Data object.

Since

7.0

  • Constructor Details

    • FileData

      public FileData(File file)

      Creates a new Data wrapper for a file.

      Parameters
      • file: The file to be wrapped.
  • Method Details

    • appendTo

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

      public long getSize() throws IOException

      Gets the size of the data content.

      Returns

      Size of content in bytes.

      Throws
      • IOException
      Specified by:
      getSize in interface Data
      Throws:
      IOException