gov.nist.microanalysis.EPQTools
Class WriteSpectrumAsBinary

java.lang.Object
  extended by gov.nist.microanalysis.EPQTools.WriteSpectrumAsBinary

public class WriteSpectrumAsBinary
extends java.lang.Object

A pure static class that writes a ISpectrumData object to a binary stream. Only the channel data is written. Each channel is written as 4-byte value so the total length of the output is spec.getChannelCount()*4. The byte ordering is the big-endian.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Constructor Summary
WriteSpectrumAsBinary()
           
 
Method Summary
static int itemSize()
          itemSize - The size of a single item in bytes within the binary object.
static int length(ISpectrumData spec)
          length - Returns the number of atomic data items that will be written to the stream.
static int size(ISpectrumData spec)
          size - Returns the number of bytes that would be output to the OutputStream by WriteSpectrumAsBinary.write.
static void write(ISpectrumData spec, java.io.OutputStream os)
          write - Write the argument ISpectrumData object to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteSpectrumAsBinary

public WriteSpectrumAsBinary()
Method Detail

write

public static void write(ISpectrumData spec,
                         java.io.OutputStream os)
                  throws EPQException
write - Write the argument ISpectrumData object to the specified OutputStream.

Parameters:
spec - ISpectrumData
os - OutputStream
Throws:
EPQException

size

public static int size(ISpectrumData spec)
size - Returns the number of bytes that would be output to the OutputStream by WriteSpectrumAsBinary.write.

Parameters:
spec - ISpectrumData
Returns:
int

length

public static int length(ISpectrumData spec)
length - Returns the number of atomic data items that will be written to the stream. The size of each atomic data item is returned by itemSize().

Parameters:
spec - ISpectrumData
Returns:
int

itemSize

public static int itemSize()
itemSize - The size of a single item in bytes within the binary object. (Equal to 4)

Returns:
int