com.yobotics.simulationconstructionset
Class YoDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by com.yobotics.simulationconstructionset.YoDataInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class YoDataInputStream
extends java.io.DataInputStream

This class is a drop-in replacement for DataInputStream. It exposes all of the same public interface, and only possesses one "additional" method:

readASCIILine()
. This method is an exact duplicate of the
readLine()
method from DataInputStream. It only has a new name because the original method is final and so can't be overridden. This class was created to get around the deprecation issues with the original method. Should the old method be removed from DataInputStream in future releases, we will be able to retain the functionality.

Version:
1.0, Added July 5 2012
Author:
Doug Stephen

Constructor Summary
YoDataInputStream(java.io.InputStream in)
           
 
Method Summary
 java.lang.String readASCIILine()
          This is a direct copy of the deprecated method
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YoDataInputStream

public YoDataInputStream(java.io.InputStream in)
Method Detail

readASCIILine

public final java.lang.String readASCIILine()
                                     throws java.io.IOException
This is a direct copy of the deprecated method
readLine()
from DataInputStream. It has been renamed to
readASCIILine()
because of the
final
status of the method, as it can't be overridden. This method is only in place to preserve the functionality of the readLine method in spite of its deprecation. Cursory analysis indicates that the only reason the is deprecated is that it doesn't gracefully handle UTF encoded data; because all of our text data is encoded in ASCII and because our randomly generated unit tests routinely pass, we will hold to the idea that this method satisfies our needs and that we shouldn't worry about the deprecation issue. We have created this method in order to continue using its functionality in the event that the deprecation leads to the code being removed from future JDK/JRE releases.

Returns:
the next ASCII formatted line from the stream
Throws:
java.io.IOException