# Class Data.StringData

java.lang.Object
com.codename1.io.Data.StringData

All Implemented Interfaces:
  `Data`

Enclosing interface:
  `Data`

public static class Data.StringData extends Object implements Data

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Data

  `Data.ByteData, Data.FileData, Data.StorageData, Data.StringData`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringData(String str)`
  `StringData(String str, String charset)`

- ## Method Summary

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

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### StringData

    public StringData(String str)

  - ### StringData

    public StringData(String str, String charset)

- ## Method Details

  - ### appendTo

    public void appendTo(OutputStream output) throws IOException
    Description copied from interface: `Data`

    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
    Description copied from interface: `Data`

    Gets the size of the data content.

    ###### Returns

    Size of content in bytes.

    ###### Throws

    - `IOException`
    Specified by:
      `getSize` in interface `Data`
    Throws:
      `IOException`