io
Class FrameWriter

java.lang.Object
  extended by io.FrameWriter

public class FrameWriter
extends java.lang.Object


Constructor Summary
FrameWriter(int frameSize)
          Generate a FrameWriter that writes to stdout
FrameWriter(int frameSize, boolean ufv)
          Generate a FrameWriter that writes to stdout
FrameWriter(int frameSize, java.lang.String fileName)
          Generate a FrameWriter that writes to the given file
FrameWriter(int frameSize, java.lang.String fileName, boolean ufv)
          Generate a FrameWriter that writes to the given file
 
Method Summary
 void close()
           
 void finalize()
          In the end, close the data file to prevent data loss!
 void write(double[] buf)
          To write the frame, pack the doubles in a byte array
static void writeDoubleArray(java.io.OutputStream os, double[] buf)
          Write a double array to the given stream (raw)
static void writeUFV(java.io.OutputStream os, double[] buf)
          Write UFVs: blocks of floats, for compatibility with the old recognition system
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameWriter

public FrameWriter(int frameSize)
            throws java.io.IOException
Generate a FrameWriter that writes to stdout

Parameters:
frameSize - size of output frames
Throws:
java.io.IOException

FrameWriter

public FrameWriter(int frameSize,
                   boolean ufv)
            throws java.io.IOException
Generate a FrameWriter that writes to stdout

Parameters:
frameSize - size of output frames
Throws:
java.io.IOException

FrameWriter

public FrameWriter(int frameSize,
                   java.lang.String fileName)
            throws java.io.IOException
Generate a FrameWriter that writes to the given file

Parameters:
frameSize -
fileName -
Throws:
java.io.IOException

FrameWriter

public FrameWriter(int frameSize,
                   java.lang.String fileName,
                   boolean ufv)
            throws java.io.IOException
Generate a FrameWriter that writes to the given file

Parameters:
frameSize -
fileName -
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

finalize

public void finalize()
              throws java.lang.Throwable
In the end, close the data file to prevent data loss!

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

write

public void write(double[] buf)
           throws java.io.IOException
To write the frame, pack the doubles in a byte array

Parameters:
buf -
Throws:
java.io.IOException

writeDoubleArray

public static void writeDoubleArray(java.io.OutputStream os,
                                    double[] buf)
                             throws java.io.IOException
Write a double array to the given stream (raw)

Parameters:
os - OutputStream to use
buf -
Throws:
java.io.IOException

writeUFV

public static void writeUFV(java.io.OutputStream os,
                            double[] buf)
                     throws java.io.IOException
Write UFVs: blocks of floats, for compatibility with the old recognition system

Parameters:
os -
buf -
Throws:
java.io.IOException