SunSPOT host API V3.0


com.sun.spot.client
Class Flashable

java.lang.Object
  extended by com.sun.spot.client.Flashable

public class Flashable
extends Object

Flashable represents data to be flashed to a SPOT, which may be either a host file or an in-memory byte array. It is used in the implementation of various ISpotClientCommands.


Constructor Summary
Flashable(File file)
          Create a Flashable as a wrapper for a host file
Flashable(String name, byte[] contents)
          Create a Flashable as a wrapper for a byte array
 
Method Summary
 void checkFileSize(int space)
          Check that the file will fit in the available space, and if not, throw SpotClientFailureException
 byte[] getContents()
           
 InputStream getInputStream()
           
 String getName()
           
 long length()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Flashable

public Flashable(String name,
                 byte[] contents)
Create a Flashable as a wrapper for a byte array

Parameters:
name - used for user interface reporting
contents - the byte array to be flashed

Flashable

public Flashable(File file)
          throws IOException
Create a Flashable as a wrapper for a host file

Parameters:
file - the file containing the data to be flashed
Throws:
IOException
Method Detail

length

public long length()
Returns:
The number of bytes of data in the flashable

getName

public String getName()
Returns:
A user-readable name for the flashable

getInputStream

public InputStream getInputStream()
Returns:
A stream from which the flashable contents can be read

getContents

public byte[] getContents()
Returns:
The flashable contents as a byte array

checkFileSize

public void checkFileSize(int space)
Check that the file will fit in the available space, and if not, throw SpotClientFailureException

Parameters:
space -

SunSPOT host API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.