Class FixedLengthStringIO

java.lang.Object
  extended by FixedLengthStringIO

public class FixedLengthStringIO
extends java.lang.Object

A class whose methods write and retrieve fixed-length strings.

Version:
SCCC West - Copyright (c) 2005
Author:
Carl B. Struck

Constructor Summary
FixedLengthStringIO()
           
 
Method Summary
static java.lang.String readFixedLengthString(int size, java.io.DataInput inFile)
          Reads and returns a string of fixed-length size from a RandomAccessFile object.
static void writeFixedLengthString(java.lang.String outString, int size, java.io.DataOutput outFile)
          Writes a string of fixed-length size to a RandomAccessFile object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedLengthStringIO

public FixedLengthStringIO()
Method Detail

readFixedLengthString

public static java.lang.String readFixedLengthString(int size,
                                                     java.io.DataInput inFile)
                                              throws java.io.IOException
Reads and returns a string of fixed-length size from a RandomAccessFile object.

Parameters:
size - an int which is the number of characters to read
infile - the RandomAccess file object which is assigned to the DataInput object
Returns:
The string of characters which was read from the RandomAccessFile
Throws:
java.io.IOException

writeFixedLengthString

public static void writeFixedLengthString(java.lang.String outString,
                                          int size,
                                          java.io.DataOutput outFile)
                                   throws java.io.IOException
Writes a string of fixed-length size to a RandomAccessFile object.

Parameters:
outString - the string to be written to the RandomAccessFile object
size - an int which is the number of characters to be written
outfile - the RandomAccess file object which is assigned to the DataOutput object
Throws:
java.io.IOException