SunSPOT host API V3.0


com.sun.spot.suiteconverter
Class SigningOutputStream

java.lang.Object
  extended by com.sun.spot.suiteconverter.SigningOutputStream
All Implemented Interfaces:
DataOutput

public class SigningOutputStream
extends Object
implements DataOutput

SigningOutputStream wraps a DataOutputStream with the ability to optionally append signatures created using a SPOT SDK's private key. See flushAndAppendSignature() and flushWithoutSignature() Note that nothing is written to the underlying DataOutputStream until one of those two methods is called. In particular, flush() does NOT flush the underlying DataOutputStream.


Field Summary
static byte SIGNATURE_VERSION
           
 
Constructor Summary
SigningOutputStream(DataOutputStream dos)
          Create a SigningOutputStream
 
Method Summary
 void close()
           
 void flush()
           
 void flushAndAppendSignature()
          Append a signature created using the SPOT SDK's private key to the underlying DataOutputStream and flush the output.
 void flushWithoutSignature()
          Flush the output through to the underlying DataOutputStream without appending a signature.
 void write(byte[] arg0)
           
 void write(byte[] arg0, int arg1, int arg2)
           
 void write(int arg0)
           
 void writeBoolean(boolean arg0)
           
 void writeByte(int arg0)
           
 void writeBytes(String arg0)
           
 void writeChar(int arg0)
           
 void writeChars(String arg0)
           
 void writeDouble(double arg0)
           
 void writeFloat(float arg0)
           
 void writeInt(int arg0)
           
 void writeLong(long arg0)
           
 void writeShort(int arg0)
           
 void writeUTF(String arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNATURE_VERSION

public static final byte SIGNATURE_VERSION
See Also:
Constant Field Values
Constructor Detail

SigningOutputStream

public SigningOutputStream(DataOutputStream dos)
Create a SigningOutputStream

Parameters:
dos - the DataOutputStream to wrap
Method Detail

flushAndAppendSignature

public void flushAndAppendSignature()
                             throws IOException
Append a signature created using the SPOT SDK's private key to the underlying DataOutputStream and flush the output.

Throws:
IOException

flushWithoutSignature

public void flushWithoutSignature()
                           throws IOException
Flush the output through to the underlying DataOutputStream without appending a signature.

Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Throws:
IOException

write

public void write(byte[] arg0,
                  int arg1,
                  int arg2)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

write

public void write(byte[] arg0)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

write

public void write(int arg0)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

writeBoolean

public void writeBoolean(boolean arg0)
                  throws IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
IOException

writeByte

public void writeByte(int arg0)
               throws IOException
Specified by:
writeByte in interface DataOutput
Throws:
IOException

writeBytes

public void writeBytes(String arg0)
                throws IOException
Specified by:
writeBytes in interface DataOutput
Throws:
IOException

writeChar

public void writeChar(int arg0)
               throws IOException
Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeChars

public void writeChars(String arg0)
                throws IOException
Specified by:
writeChars in interface DataOutput
Throws:
IOException

writeDouble

public void writeDouble(double arg0)
                 throws IOException
Specified by:
writeDouble in interface DataOutput
Throws:
IOException

writeFloat

public void writeFloat(float arg0)
                throws IOException
Specified by:
writeFloat in interface DataOutput
Throws:
IOException

writeInt

public void writeInt(int arg0)
              throws IOException
Specified by:
writeInt in interface DataOutput
Throws:
IOException

writeLong

public void writeLong(long arg0)
               throws IOException
Specified by:
writeLong in interface DataOutput
Throws:
IOException

writeShort

public void writeShort(int arg0)
                throws IOException
Specified by:
writeShort in interface DataOutput
Throws:
IOException

writeUTF

public void writeUTF(String arg0)
              throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

SunSPOT host API V3.0


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