Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Sct.File.OStreamFile Class Reference

Writes directly to a file using a binary representation Uses the NIO classes for speed, but doesn't use memory-mapped files on the assumption that the file size will be small. More...

List of all members.

Public Member Functions

 OStreamFile (NameFile name) throws IOException
 Creates a new instance of OStreamFile.

 OStreamFile (byte[] output)
 Creates an OStreamFile that writes to a given byte[] The given array must be large enough to hold all the object being written.

void close () throws IOException
 This must be called to close the underlying stream.

void writeBoolean (String name, boolean b) throws java.io.IOException
void writeBooleanArray (String name, boolean[] b) throws java.io.IOException
void writeByte (String name, byte b, boolean sign) throws java.io.IOException
void writeByteArray (String name, byte[] b, boolean sign) throws java.io.IOException
void writeDouble (String name, double d) throws java.io.IOException
void writeDoubleArray (String name, double[] d) throws java.io.IOException
void writeFloat (String name, float f) throws java.io.IOException
void writeFloatArray (String name, float[] f) throws java.io.IOException
void writeInt (String name, int i, boolean sign) throws java.io.IOException
void writeIntArray (String name, int[] i, boolean sign) throws java.io.IOException
void writeLong (String name, long i, boolean sign) throws java.io.IOException
void writeLongArray (String name, long[] i, boolean sign) throws java.io.IOException
void writeShort (String name, short s, boolean sign) throws java.io.IOException
void writeShortArray (String name, short[] s, boolean sign) throws java.io.IOException
void writeString (String name, String s) throws java.io.IOException
void writeStringArray (String name, String[] s) throws java.io.IOException

Private Member Functions

void checkAndFlush (int bytes) throws IOException
void write () throws IOException

Private Attributes

FileChannel file
ByteBuffer buffer


Detailed Description

Writes directly to a file using a binary representation Uses the NIO classes for speed, but doesn't use memory-mapped files on the assumption that the file size will be small.

Author:
Matthew Palmer

Definition at line 19 of file OStreamFile.java.


Constructor & Destructor Documentation

Sct.File.OStreamFile.OStreamFile byte[]  output  ) 
 

Creates an OStreamFile that writes to a given byte[] The given array must be large enough to hold all the object being written.

If not, the array will contain the last section of the data. The object probably ends when the last contiguous block of zeros starts.

Parameters:
output the array which will be filled with the binary representation of the object.

Definition at line 37 of file OStreamFile.java.


The documentation for this class was generated from the following file:
Generated on Thu Jul 15 09:56:38 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5