jAER project on SourceForge

net.sf.jaer.eventio
Class AEFileOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by net.sf.jaer.eventio.AEFileOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class AEFileOutputStream
extends java.io.DataOutputStream

Class to stream out packets of events in binary. The file format (as of version 2.0) is
int32 address
int32 timestamp
repeated for the number of events in the file.

Prior to version 2.0 files, each address was an int16 address. The timestamp tick is 1us.

Author:
tobi

Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
AEFileOutputStream(java.io.OutputStream os)
          Creates a new instance of AEOutputStream.
 
Method Summary
 void writeHeaderLine(java.lang.String s)
          Writes a comment header line.
 void writePacket(AEPacketRaw ae)
          Writes the packet out as sequence of address/timestamp's, just as they came as input from the device.
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

AEFileOutputStream

public AEFileOutputStream(java.io.OutputStream os)
Creates a new instance of AEOutputStream.

Parameters:
os - an output stream, e.g. from new BufferedOutputStream(new FileOutputStream(File f).
Method Detail

writePacket

public void writePacket(AEPacketRaw ae)
                 throws java.io.IOException
Writes the packet out as sequence of address/timestamp's, just as they came as input from the device. The notion of a packet is discarded to simplify later reading an input stream from the output stream result.

Parameters:
ae - a raw addresse-event packet
Throws:
java.io.IOException

writeHeaderLine

public void writeHeaderLine(java.lang.String s)
                     throws java.io.IOException
Writes a comment header line. Writes the string with prepended '#' and appended '\r\n'

Parameters:
s - the string
Throws:
java.io.IOException

jAER project on SourceForge