| java.lang.Object tcl.lang.TclByteArray
TclByteArray | public class TclByteArray implements InternalRep(Code) | | This class implements the binary data object type in Tcl.
|
Method Summary | |
public void | dispose() Implement this no-op for the InternalRep interface. | public InternalRep | duplicate() Returns a duplicate of the current object. | public static byte[] | getBytes(Interp interp, TclObject tobj) Returns the bytes of a ByteArray object. | final public static int | getLength(Interp interp, TclObject tobj) Queries the length of the byte array. | public static TclObject | newInstance(byte[] b, int position, int length) Creates a new instance of a TclObject with a TclByteArray internal
rep. | public static TclObject | newInstance(byte[] b) Creates a new instance of a TclObject with a TclByteArray internal
rep. | public static TclObject | newInstance() Creates a new instance of a TclObject with an empty TclByteArray
internal rep. | static void | setByteArrayFromAny(Interp interp, TclObject tobj) Called to convert the other object's internal rep to a ByteArray. | public static byte[] | setLength(Interp interp, TclObject tobj, int length) This method changes the length of the byte array for this
object. | public String | toString() Called to query the string representation of the Tcl object. |
dispose | public void dispose()(Code) | | Implement this no-op for the InternalRep interface.
|
duplicate | public InternalRep duplicate()(Code) | | Returns a duplicate of the current object.
Parameters: obj - the TclObject that contains this internalRep. |
getBytes | public static byte[] getBytes(Interp interp, TclObject tobj)(Code) | | Returns the bytes of a ByteArray object. If tobj is not a ByteArray
object, an attempt will be made to convert it to a ByteArray.
Parameters: interp - the current interpreter. Parameters: tobj - the byte array object. a byte array. exception: TclException - if tobj is not a valid ByteArray. |
getLength | final public static int getLength(Interp interp, TclObject tobj)(Code) | | Queries the length of the byte array. If tobj is not a byte array
object, an attempt will be made to convert it to a byte array.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a byte array. the length of the byte array. exception: TclException - if tobj is not a valid byte array. |
newInstance | public static TclObject newInstance(byte[] b, int position, int length)(Code) | | Creates a new instance of a TclObject with a TclByteArray internal
rep.
the TclObject with the given byte array value. |
newInstance | public static TclObject newInstance(byte[] b)(Code) | | Creates a new instance of a TclObject with a TclByteArray internal
rep.
the TclObject with the given byte array value. |
newInstance | public static TclObject newInstance()(Code) | | Creates a new instance of a TclObject with an empty TclByteArray
internal rep.
the TclObject with the empty byte array value. |
setByteArrayFromAny | static void setByteArrayFromAny(Interp interp, TclObject tobj)(Code) | | Called to convert the other object's internal rep to a ByteArray.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to convert to use the ByteArray internal rep. exception: TclException - if the object doesn't contain a valid ByteArray. |
setLength | public static byte[] setLength(Interp interp, TclObject tobj, int length)(Code) | | This method changes the length of the byte array for this
object. Once the caller has set the length of the array, it
is acceptable to directly modify the bytes in the array up until
Tcl_GetStringFromObj() has been called on this object.
Results:
The new byte array of the specified length.
Side effects:
Allocates enough memory for an array of bytes of the requested
size. When growing the array, the old array is copied to the
new array; new bytes are undefined. When shrinking, the
old array is truncated to the specified length.
|
toString | public String toString()(Code) | | Called to query the string representation of the Tcl object. This
method is called only by TclObject.toString() when
TclObject.stringRep is null.
the string representation of the Tcl object. |
|
|