All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.roguewave.vsj.VirtualInputStream

public interface VirtualInputStream
The VirtualInputStream interface corresponds to the Tools.h++ abstract base class RWvistream. The interface contains methods to input basic data and restore objects that were output or saved from either a C++ program using an implementation of the Tools.h++ class RWvostream or a Java program using the VirtualOutputStream interface.

Each method that reads data is meant to be used in conjuction with a specific RWvostream or VirtualOutputStream method that wrote the data. These correspondences are given in the method descriptions below.

With regard to naming conventions, you'll note that C++ methods in RWvistream that overload the extraction operator are provided here as method names beginning with extract. For example,

   RWvistream& RWvistream::operator>>(char&);
 
is represented here as
   char VirtualInputStream.extractChar();
 
Also, because we can't directly pass basic types by reference in Java, the input methods take no parameters but return the value instead. This, in turn, means that we can't overload the method names as we do in C++, thus we include the type in the name as with extractChar(), extractInt(), etc.

Finally, we use widening, where we can, to deal with C++ basic types such as unsigned int that don't have Java counterparts. For example, the method

   long VirtualInputStream.extractUnsignedInt()
 
returns a long since the range of a typical C++ unsigned int contains values that won't necessarily fit into a Java int. While we've done our best to ensure that the types we return can hold any value read from the stream, in the end we cannot guarantee this since ranges of basic types in C++ are implementation defined.

See Also:
VirtualOutputStream

Method Index

 o extractChar()
Read a character.
 o extractDouble()
Read a double.
 o extractFloat()
Read a float.
 o extractInt()
Read an int.
 o extractLong()
Read a long.
 o extractShort()
Read a short.
 o extractUnsignedChar()
Read an unsigned character.
 o extractUnsignedInt()
Read an unsigned int.
 o extractUnsignedLong()
Read an unsigned long.
 o extractUnsignedShort()
Read an unsigned short.
 o extractWChar()
Read a wide character.
 o getChar()
Read a character.
 o getChars(int)
Read an array of characters.
 o getDoubles(int)
Read an array of doubles.
 o getFloats(int)
Read an array of floats.
 o getInts(int)
Read an array of ints.
 o getLongs(int)
Read an array of longs.
 o getRestoreContext()
Get the restore context maintained by this stream.
 o getShorts(int)
Read an array of shorts.
 o getString(int)
Read a string.
 o getUnsignedChar()
Read an unsigned character.
 o getUnsignedChars(int)
Read an array of unsigned characters.
 o getUnsignedInts(int)
Read an array of unsigned ints.
 o getUnsignedLongs(int)
Read an array of unsigned longs.
 o getUnsignedShorts(int)
Read an array of unsigned shorts.
 o getWChar()
Read a wide character.
 o getWChars(int)
Read an array of wide characters.
 o restoreObject(ObjectStreamer)
Read an object from the stream using the given ObjectStreamer.

Methods

 o restoreObject
 public abstract Object restoreObject(ObjectStreamer streamer) throws IOException
Read an object from the stream using the given ObjectStreamer. The object may have been saved from either a C++ or a Java program. The basic types which make up the serialized object must have been written with a corresponding C++ RWvostream or a Java VirtualOutputStream. It is up to the ObjectStreamer to understand how those basic types, along with any meta-information, are arranged to represent the object.

Note that ObjectStreamers for classes in Tools.h++, JTools, and the JDK are supplied with this product. See the User's Guide.

 o getRestoreContext
 public abstract RestoreContext getRestoreContext()
Get the restore context maintained by this stream. The restore context keeps track of objects as they are read in so that back-references can be used to maintain the shape of a graph of objects.

 o getString
 public abstract String getString(int count) throws IOException
Read a string. Reads at most count characters. If more characters were output to the stream, eats the excess characters so that the stream remains in sync.

Corresponding output functions:
From C++From Java
RWvostream::putString(const char*, size_t) VirtualOutputStream.putString(String, int)

 o extractChar
 public abstract char extractChar() throws IOException
Read a character. The C++ virtual stream interface allows for two different ways of interpreting a char: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractChar and getChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(char) VirtualOutputStream.insertChar(char)

See Also:
getChar
 o getChar
 public abstract char getChar() throws IOException
Read a character. The C++ virtual stream interface allows for two different ways of interpreting a char: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractChar and getChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::put(char) VirtualOutputStream.putChar(char)

See Also:
extractChar
 o extractWChar
 public abstract char extractWChar() throws IOException
Read a wide character. The C++ virtual stream interface allows for two different ways of interpreting a wchar_t: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractWChar and getWChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(wchar_t) VirtualOutputStream.insertWChar(char)

See Also:
getWChar
 o getWChar
 public abstract char getWChar() throws IOException
Read a wide character. The C++ virtual stream interface allows for two different ways of interpreting a wchar_t: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractWChar and getWChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::put(wchar_t) VirtualOutputStream.putWChar(char)

See Also:
extractWChar
 o extractUnsignedChar
 public abstract char extractUnsignedChar() throws IOException
Read an unsigned character. The C++ virtual stream interface allows for two different ways of interpreting an unsigned char: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractUnsignedChar and getUnsignedChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(unsigned char) VirtualOutputStream.insertUnsignedChar(char)

See Also:
getUnsignedChar
 o getUnsignedChar
 public abstract char getUnsignedChar() throws IOException
Read an unsigned character. The C++ virtual stream interface allows for two different ways of interpreting an unsigned char: as a character, or as a number. Although this distinction doesn't really apply to Java, it is still important to choose the correct method between extractUnsignedChar and getUnsignedChar depending on the method used to output the character.

Corresponding output functions:
From C++From Java
RWvostream::put(unsigned char) VirtualOutputStream.putUnsignedChar(char)

See Also:
extractUnsignedChar
 o extractDouble
 public abstract double extractDouble() throws IOException
Read a double.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(double) VirtualOutputStream.insertDouble(double)

 o extractFloat
 public abstract float extractFloat() throws IOException
Read a float.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(float) VirtualOutputStream.insertFloat(float)

 o extractInt
 public abstract int extractInt() throws IOException
Read an int.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(int) VirtualOutputStream.insertInt(int)

 o extractUnsignedInt
 public abstract long extractUnsignedInt() throws IOException
Read an unsigned int.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(unsigned int) VirtualOutputStream.insertUnsignedInt(long)

 o extractShort
 public abstract short extractShort() throws IOException
Read a short.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(short) VirtualOutputStream.insertShort(short)

 o extractUnsignedShort
 public abstract int extractUnsignedShort() throws IOException
Read an unsigned short.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(unsigned short) VirtualOutputStream.insertUnsignedShort(int)

 o extractLong
 public abstract long extractLong() throws IOException
Read a long.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(long) VirtualOutputStream.insertLong(long)

 o extractUnsignedLong
 public abstract long extractUnsignedLong() throws IOException
Read an unsigned long.

Corresponding output functions:
From C++From Java
RWvostream::operator<<(unsigned long) VirtualOutputStream.insertUnsignedLong(long)

 o getChars
 public abstract char[] getChars(int count) throws IOException
Read an array of characters.

Corresponding output functions:
From C++From Java
RWvostream::put(const char*, size_t) VirtualOutputStream.putChars(char[], int)

 o getWChars
 public abstract char[] getWChars(int count) throws IOException
Read an array of wide characters.

Corresponding output functions:
From C++From Java
RWvostream::put(const wchar_t*, size_t) VirtualOutputStream.putWChars(char[], int)

 o getUnsignedChars
 public abstract char[] getUnsignedChars(int count) throws IOException
Read an array of unsigned characters.

Corresponding output functions:
From C++From Java
RWvostream::put(const unsigned char*, size_t) VirtualOutputStream.putUnsignedChars(char[], int)

 o getDoubles
 public abstract double[] getDoubles(int count) throws IOException
Read an array of doubles.

Corresponding output functions:
From C++From Java
RWvostream::put(const double*, size_t) VirtualOutputStream.putDoubles(double[], int)

 o getFloats
 public abstract float[] getFloats(int count) throws IOException
Read an array of floats.

Corresponding output functions:
From C++From Java
RWvostream::put(const float*, size_t) VirtualOutputStream.putFloats(float[], int)

 o getInts
 public abstract int[] getInts(int count) throws IOException
Read an array of ints.

Corresponding output functions:
From C++From Java
RWvostream::put(const int*, size_t) VirtualOutputStream.putInts(int[], int)

 o getUnsignedInts
 public abstract long[] getUnsignedInts(int count) throws IOException
Read an array of unsigned ints.

Corresponding output functions:
From C++From Java
RWvostream::put(const unsigned int*, size_t) VirtualOutputStream.putunsignedInt(long[], int)

 o getShorts
 public abstract short[] getShorts(int count) throws IOException
Read an array of shorts.

Corresponding output functions:
From C++From Java
RWvostream::put(const short*, size_t) VirtualOutputStream.putShorts(short[], int)

 o getUnsignedShorts
 public abstract int[] getUnsignedShorts(int count) throws IOException
Read an array of unsigned shorts.

Corresponding output functions:
From C++From Java
RWvostream::put(const unsigned short*, size_t) VirtualOutputStream.putUnsignedShorts(int[], int)

 o getLongs
 public abstract long[] getLongs(int count) throws IOException
Read an array of longs.

Corresponding output functions:
From C++From Java
RWvostream::put(const long*, size_t) VirtualOutputStream.putLong(long[], int)

 o getUnsignedLongs
 public abstract long[] getUnsignedLongs(int count) throws IOException
Read an array of unsigned longs.

Corresponding output functions:
From C++From Java
RWvostream::put(const unsigned long*, size_t) VirtualOutputStream.putUnsignedLong(long[], int)


All Packages  Class Hierarchy  This Package  Previous  Next  Index