All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.roguewave.vsj.VirtualOutputStream

public interface VirtualOutputStream
The VirtualOutputStream interface corresponds to the Tools.h++ abstract base class RWvostream. The interface contains methods to output basic data and save objects to be input or restored in either a C++ program using an implementation of the Tools.h++ class RWvistream or a Java program using the VirtualInputStream interface.

Each method that writes data is meant to be used in conjuction with a specific RWvistream or VirtualInputStream method to read the data. These correspondences are given in the method descriptions below.

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

   RWvostream& RWvostream::operator<<(char);
 
is represented here as
   VirtualOutputStream VirtualOutputStream.insertChar(char);
 
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
   VirtualOutputStream VirtualOutputStream.insertUnsignedInt(long)
 
takes 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 use can hold any value expected by a C++ program, in the end we cannot guarantee this since ranges of basic types in C++ are implementation defined.

See Also:
VirtualInputStream

Method Index

 o flush()
flush the underlying stream
 o getSaveContext()
Return the save context maintained by this stream.
 o insertChar(char)
Write a character.
 o insertDouble(double)
Write a double.
 o insertFloat(float)
Write a float.
 o insertInt(int)
Write an int.
 o insertLong(long)
Write a long.
 o insertShort(short)
Write a short.
 o insertUnsignedChar(char)
Write an unsigned character.
 o insertUnsignedInt(long)
Write an unsigned int.
 o insertUnsignedLong(long)
Write an unsigned long.
 o insertUnsignedShort(int)
Write an unsigned short.
 o insertWChar(char)
Write a wide character.
 o putChar(char)
Write a character.
 o putChars(char[], int)
Write an array of characters.
 o putDoubles(double[], int)
Write an array of doubles.
 o putFloats(float[], int)
Write an array of floats.
 o putInts(int[], int)
Write an array of ints.
 o putLongs(long[], int)
Write an array of longs.
 o putShorts(short[], int)
Write an array of shorts.
 o putString(String, int)
Write a string.
 o putUnsignedChar(char)
Write an unsigned character.
 o putUnsignedChars(char[], int)
Write an array of unsigned characters.
 o putUnsignedInts(long[], int)
Write an array of unsigned ints.
 o putUnsignedLongs(long[], int)
Write an array of unsigned longs.
 o putUnsignedShorts(int[], int)
Write an array of unsigned shorts.
 o putWChar(char)
Write a wide character.
 o putWChars(char[], int)
Write an array of wide characters.
 o saveObject(Object, ObjectStreamer)
Write an object to the stream using the given ObjectStreamer.

Methods

 o saveObject
 public abstract VirtualOutputStream saveObject(Object data,
                                                ObjectStreamer streamer) throws IOException
Write an object to the stream using the given ObjectStreamer. The ObjectStreamer may call this method recursively in order to save a graph of objects. The object may later be restored from either a C++ or a Java program. The basic types which make up the serialized object must be read with a corresponding C++ RWvistream or a Java VirtualInputStream. It is up to the ObjectStreamer to understand how to arrange those basic types, possibly coupled with additional meta-information, to represent the object being written.

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

 o getSaveContext
 public abstract SaveContext getSaveContext()
Return the save context maintained by this stream. The save context keeps track of objects as they are written so that back-references can be used to maintain the shape of a graph of objects.

 o putString
 public abstract VirtualOutputStream putString(String data,
                                               int count) throws IOException
Write a string. Writes at most count characters, stopping at the end of the string if the string length is less than count.

Corresponding input functions:
From C++From Java
RWvistream::getString(const char*, size_t) VirtualInputStream.getString(int)

 o putChar
 public abstract VirtualOutputStream putChar(char data) throws IOException
Write 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 insertChar and putChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::get(char) VirtualInputStream.getChar()

See Also:
insertChar
 o insertChar
 public abstract VirtualOutputStream insertChar(char data) throws IOException
Write 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 insertChar and putChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(char&) VirtualInputStream.extractChar()

See Also:
putChar
 o putWChar
 public abstract VirtualOutputStream putWChar(char data) throws IOException
Write 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 insertWChar and putWChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::get(wchar_t&) VirtualInputStream.getWChar()

See Also:
insertWChar
 o insertWChar
 public abstract VirtualOutputStream insertWChar(char data) throws IOException
Write 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 insertWChar and putWChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(wchar_t&) VirtualInputStream.extractWChar()

See Also:
putWChar
 o putUnsignedChar
 public abstract VirtualOutputStream putUnsignedChar(char data) throws IOException
Write 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 insertUnsignedChar and putUnsignedChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::get(unsigned char&) VirtualInputStream.getUnsignedChar()

See Also:
insertUnsignedChar
 o insertUnsignedChar
 public abstract VirtualOutputStream insertUnsignedChar(char data) throws IOException
Write 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 insertUnsignedChar and putUnsignedChar depending on the method to be used to input the character.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(unsigned char&) VirtualInputStream.extractUnsignedChar()

See Also:
putUnsignedChar
 o insertDouble
 public abstract VirtualOutputStream insertDouble(double data) throws IOException
Write a double.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(double&) VirtualInputStream.extractDouble()

 o insertFloat
 public abstract VirtualOutputStream insertFloat(float data) throws IOException
Write a float.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(float&) VirtualInputStream.extractFloat()

 o insertInt
 public abstract VirtualOutputStream insertInt(int data) throws IOException
Write an int.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(int&) VirtualInputStream.extractInt()

 o insertUnsignedInt
 public abstract VirtualOutputStream insertUnsignedInt(long data) throws IOException
Write an unsigned int.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(unsigned int&) VirtualInputStream.extractUnsignedInt()

 o insertShort
 public abstract VirtualOutputStream insertShort(short data) throws IOException
Write a short.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(short&) VirtualInputStream.extractShort()

 o insertUnsignedShort
 public abstract VirtualOutputStream insertUnsignedShort(int data) throws IOException
Write an unsigned short.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(unsigned short&) VirtualInputStream.extractUnsignedShort()

 o insertLong
 public abstract VirtualOutputStream insertLong(long data) throws IOException
Write a long.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(long&) VirtualInputStream.extractLong()

 o insertUnsignedLong
 public abstract VirtualOutputStream insertUnsignedLong(long data) throws IOException
Write an unsigned long.

Corresponding input functions:
From C++From Java
RWvistream::operator>>(unsigned long&) VirtualInputStream.extractUnsignedLong()

 o putChars
 public abstract VirtualOutputStream putChars(char data[],
                                              int count) throws IOException
Write an array of characters.

Corresponding input functions:
From C++From Java
RWvistream::get(char*, size_t) VirtualInputStream.getChars(int)

 o putWChars
 public abstract VirtualOutputStream putWChars(char data[],
                                               int count) throws IOException
Write an array of wide characters.

Corresponding input functions:
From C++From Java
RWvistream::get(wchar_t*, size_t) VirtualInputStream.getWChars(int)

 o putUnsignedChars
 public abstract VirtualOutputStream putUnsignedChars(char data[],
                                                      int count) throws IOException
Write an array of unsigned characters.

Corresponding input functions:
From C++From Java
RWvistream::get(unsigned char*, size_t) VirtualInputStream.getUnsignedChars(int)

 o putDoubles
 public abstract VirtualOutputStream putDoubles(double data[],
                                                int count) throws IOException
Write an array of doubles.

Corresponding input functions:
From C++From Java
RWvistream::get(double*, size_t) VirtualInputStream.getDoubles(int)

 o putFloats
 public abstract VirtualOutputStream putFloats(float data[],
                                               int count) throws IOException
Write an array of floats.

Corresponding input functions:
From C++From Java
RWvistream::get(float*, size_t) VirtualInputStream.getFloats(int)

 o putInts
 public abstract VirtualOutputStream putInts(int data[],
                                             int count) throws IOException
Write an array of ints.

Corresponding input functions:
From C++From Java
RWvistream::get(int*, size_t) VirtualInputStream.getInts(int)

 o putUnsignedInts
 public abstract VirtualOutputStream putUnsignedInts(long data[],
                                                     int count) throws IOException
Write an array of unsigned ints.

Corresponding input functions:
From C++From Java
RWvistream::get(unsigned int*, size_t) VirtualInputStream.getunsignedInt(int)

 o putShorts
 public abstract VirtualOutputStream putShorts(short data[],
                                               int count) throws IOException
Write an array of shorts.

Corresponding input functions:
From C++From Java
RWvistream::get(short*, size_t) VirtualInputStream.getShorts(int)

 o putUnsignedShorts
 public abstract VirtualOutputStream putUnsignedShorts(int data[],
                                                       int count) throws IOException
Write an array of unsigned shorts.

Corresponding input functions:
From C++From Java
RWvistream::get(unsigned short*, size_t) VirtualInputStream.getUnsignedShorts(int)

 o putLongs
 public abstract VirtualOutputStream putLongs(long data[],
                                              int count) throws IOException
Write an array of longs.

Corresponding input functions:
From C++From Java
RWvistream::get(long*, size_t) VirtualInputStream.getLong(int)

 o putUnsignedLongs
 public abstract VirtualOutputStream putUnsignedLongs(long data[],
                                                      int count) throws IOException
Write an array of unsigned longs.

Corresponding input functions:
From C++From Java
RWvistream::get(unsigned long*, size_t) VirtualInputStream.getUnsignedLong(int)

 o flush
 public abstract VirtualOutputStream flush() throws IOException
flush the underlying stream


All Packages  Class Hierarchy  This Package  Previous  Next  Index