# Class Data.StorageData

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

All Implemented Interfaces:
  `Data`

Enclosing interface:
  `Data`

public static class Data.StorageData extends Object implements Data

Wraps a Storage object 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`
  Modifier and Type
  Interface
  Description
  `static class`
  `Data.ByteData`
  Wraps a byte[] array as a Data object.
  `static class`
  `Data.FileData`
  Wraps a File as a Data object.
  `static class`
  `Data.StorageData`
  Wraps a Storage object as a Data object.
  `static class`
  `Data.StringData`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StorageData(String key)`
  Creates a new Data wrapper for a storage key.

- ## 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### StorageData

    public StorageData(String key)

    Creates a new Data wrapper for a storage key.

    ###### Parameters

    - `key`: The storage key.

- ## 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`