|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.TclByteArray
public class TclByteArray
This class implements the binary data object type in Tcl.
Method Summary | |
---|---|
static String |
decodeToString(Interp interp,
TclObject tobj,
String tclEncoding)
Interpret the bytes in the byte array according to the specified tcl encoding and return the corresponding string. |
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. |
String |
toString()
Called to query the string representation of the Tcl object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public InternalRep duplicate()
duplicate
in interface InternalRep
public void dispose()
dispose
in interface InternalRep
public String toString()
toString
in class 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)
interp
- the current interpretertobj
- object in which to change the byte array length. Object is
converted to a TclByteArraylength
- new length of the array
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.public static String decodeToString(Interp interp, TclObject tobj, String tclEncoding)
interp
- the current interpretertobj
- the object, which is converted to a TclByteArray if necessarytclEncoding
- Tcl encoding in which to decode to String. 'identity',
'binary' and null all imply that the string will be made of
chars whose lower byte is the corresponding byte from the
array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |