Class SoByteStream

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.misc.SoByteStream

public class SoByteStream extends Inventor
Converts scene graph objects to character byte streams. This class creates a byte stream representation of a scene graph, using an SoWriteAction to write path lists to an in-memory buffer. Byte streams are commonly used to transfer data in copy and paste operations. (The
invalid reference
SoWinClipboard
class passes SoByteStream data during copy and paste.)

See Also:
  • invalid reference
    SoWinClipboard
  • Constructor Details

    • SoByteStream

      public SoByteStream()
      Constructor.
  • Method Details

    • convert

      public void convert(SoNode node)
      Calls convert(node, true).
    • convert

      public void convert(SoPath path)
      Calls convert(path, true).
    • getData

      public ByteBuffer getData()
      Returns the data from the last convert() operation. This byte stream format is well suited to data transfers, like copy and paste.
    • convert

      public void convert(SoPath path, boolean binaryFormat)
      Converts the passed scene graph object(s) into a byte stream. The object(s) are passed by path. The caller may specify whether the byte stream is written in binary (true) or ASCII (false) format. The converted data can be accessed through getData() and getNumBytes().
    • unconvert

      public static Vector<SoPath> unconvert(SoByteStream byteStream)
      Takes byte stream data and unconverts it back to scene graph objects. The objects are returned in a path list.
    • convert

      public void convert(SoNode node, boolean binaryFormat)
      Converts the passed scene graph object(s) into a byte stream. The object(s) are passed by node. The caller may specify whether the byte stream is written in binary (true) or ASCII (false) format. The converted data can be accessed through getData() and getNumBytes().
    • getNumBytes

      public long getNumBytes()
      Returns the number of bytes from the last convert() operation. This byte stream format is well suited to data transfers, like copy and paste.