public class TclByteArray extends java.lang.Object implements InternalRep
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Implement this no-op for the InternalRep interface.
|
InternalRep |
duplicate()
Returns a duplicate of the current object.
|
static byte[] |
getBytes(Interp interp,
TclObject tobj)
Returns the bytes of a ByteArray object.
|
static int |
getLength(Interp interp,
TclObject tobj)
Queries the length of the byte array.
|
static TclObject |
newInstance()
Creates a new instance of a TclObject with an empty TclByteArray
internal rep.
|
static TclObject |
newInstance(byte[] b)
Creates a new instance of a TclObject with a TclByteArray internal
rep.
|
static TclObject |
newInstance(byte[] b,
int position,
int length)
Creates a new instance of a TclObject with a TclByteArray internal
rep.
|
static byte[] |
setLength(Interp interp,
TclObject tobj,
int length)
This method changes the length of the byte array for this
object.
|
java.lang.String |
toString()
Called to query the string representation of the Tcl object.
|
public InternalRep duplicate()
duplicate
in interface InternalRep
obj
- the TclObject that contains this internalRep.public void dispose()
dispose
in interface InternalRep
public java.lang.String toString()
toString
in class java.lang.Object
public static TclObject newInstance(byte[] b, int position, int length)
public static TclObject newInstance(byte[] b)
public static TclObject newInstance()
public static byte[] setLength(Interp interp, TclObject tobj, int length)
public static final int getLength(Interp interp, TclObject tobj)
interp
- current interpreter.tobj
- the TclObject to use as a byte array.TclException
- if tobj is not a valid byte array.public static byte[] getBytes(Interp interp, TclObject tobj)
interp
- the current interpreter.tobj
- the byte array object.TclException
- if tobj is not a valid ByteArray.