Package com.openinventor.inventor.misc
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 anSoWriteAction
to write path lists to an in-memory buffer. Byte streams are commonly used to transfer data in copy and paste operations. (TheSoWinClipboard
class passesSoByteStream
data during copy and paste.)- See Also:
SoWinClipboard
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoByteStream()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convert(SoNode node)
Calls convert(node, true).void
convert(SoNode node, boolean binaryFormat)
Converts the passed scene graph object(s) into a byte stream.void
convert(SoPath path)
Calls convert(path, true).void
convert(SoPath path, boolean binaryFormat)
Converts the passed scene graph object(s) into a byte stream.java.nio.ByteBuffer
getData()
Returns the data from the lastconvert()
operation.long
getNumBytes()
Returns the number of bytes from the lastconvert()
operation.static java.util.Vector<SoPath>
unconvert(SoByteStream byteStream)
Takes byte stream data and unconverts it back to scene graph objects.-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
convert
public void convert(SoNode node)
Calls convert(node, true).
-
convert
public void convert(SoPath path)
Calls convert(path, true).
-
getData
public java.nio.ByteBuffer getData()
Returns the data from the lastconvert()
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 throughgetData()
andgetNumBytes()
.
-
unconvert
public static java.util.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 throughgetData()
andgetNumBytes()
.
-
getNumBytes
public long getNumBytes()
Returns the number of bytes from the lastconvert()
operation. This byte stream format is well suited to data transfers, like copy and paste.
-
-