|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.idms.io.TraceObject
ca.idms.io.NativeObject
public class NativeObject
Provides a default implementation of the Native interface.
This class reads and writes an array of unconverted bytes,
and is used when conversion is not needed. Derived classes
can override the readNative(ca.idms.io.NativeDataInputStream) and writeNative(ca.idms.io.NativeDataOutputStream)
methods to convert data using the methods provided by the
NativeDataInputStream and NativeDataOutputStream
classes.
Native,
NativeFormat,
TraceObject| Field Summary | |
|---|---|
protected byte[] |
buffer
Buffer for data in native format. |
protected int |
length
Length of data in byte array. |
protected int |
offset
Start offset of data in byte array. |
| Fields inherited from class ca.idms.io.TraceObject |
|---|
exclude, EXCLUDE, FALSE, include, INCLUDE, logWriter, PREFIX, PROPERTIES_FILE, PROPERTIES_KEY, snap, SNAP, SNAP_BYTES, SNAP_NATIVE, SNAP_OBJECT, SNAP_SQL, snapBytes, snapNative, snapObject, snapSql, stub, trace, TRACE, TRACE_FILE, TRACE_LIFE, TRACE_NATIVE, TRACE_PRODUCT, traceLife, traceNative, traceStream, TRUE |
| Constructor Summary | |
|---|---|
protected |
NativeObject()
Creates an uninitialized NativeObject. |
|
NativeObject(byte[] buf)
Creates a NativeObject from a byte array. |
|
NativeObject(byte[] buf,
int off,
int len)
Creates an initialized NativeObject. |
|
NativeObject(int len)
Creates an initialized NativeObject. |
| Method Summary | |
|---|---|
protected java.lang.Object |
get(java.lang.reflect.Field f)
Overrides the default get method to allow the default snap method access to the value of a non-public variable. |
byte[] |
getBuffer()
Gets the byte array buffer. |
short |
getClient()
The default getClient method returns 0. |
int |
getOffset()
Gets the byte array offset. |
int |
length()
Computes the size of the native form of the object. |
int |
length(NativeFormat fmt)
Computes the size of the native form the object. |
boolean |
readBuffer(NativeDataInputStream in)
Conditionally reads the buffer from a stream. |
void |
readNative(NativeDataInputStream in)
Reads the object from a stream in native format. |
void |
snap()
Overrides snap in TraceObject and displays the byte array. |
boolean |
writeBuffer(NativeDataOutputStream out)
Conditionally writes the buffer to a stream. |
void |
writeNative(NativeDataOutputStream out)
Writes the object to a stream in native format. |
| Methods inherited from class ca.idms.io.TraceObject |
|---|
finalize, getBoolean, getClasses, getInteger, getProperty, listProperties, message, parseList, print, print, print, println, println, snap, snap, snap, snap, snap, snap, toHex, toHex, toHex, toHex, toHex, toString, trace, trace, trace, trace, trace, trace, traceEntry, unloadProperties |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] buffer
protected int offset
protected int length
| Constructor Detail |
|---|
protected NativeObject()
public NativeObject(int len)
len - length of byte array.public NativeObject(byte[] buf)
buf - an existing byte array.
public NativeObject(byte[] buf,
int off,
int len)
The byte array is referenced, not copied. The buffer can be null, which allows a derived class to defer setting the buffer. In this case the derived class is responsible for ensuring the validity of the offset and length.
buf - existing buffer.off - index of start of data.len - length of data.| Method Detail |
|---|
protected java.lang.Object get(java.lang.reflect.Field f)
throws java.lang.IllegalAccessException
get in class TraceObjectf - a Field returned by Class.getDeclaredFields
java.lang.IllegalAccessException - should not
really happen, but Field.get requires itTraceObject.snap,
TraceObject.snap()public void snap()
snap in interface Tracesnap in class TraceObjectTraceObject.get(java.lang.reflect.Field)public byte[] getBuffer()
public int getOffset()
public int length()
public short getClient()
getClient in interface Nativepublic int length(NativeFormat fmt)
length in interface Nativefmt - describes native data formats, ignored.
public void readNative(NativeDataInputStream in)
throws java.io.IOException
readNative in interface Nativein - the native buffered input stream.
java.io.IOException - if an IO error occurs
public void writeNative(NativeDataOutputStream out)
throws java.io.IOException
writeNative in interface Nativeout - the native buffered output stream.
java.io.IOException - if an IO error occurs
public boolean readBuffer(NativeDataInputStream in)
throws java.io.IOException
in - the native buffered input stream.
java.io.IOException - if an IO error occurs
public boolean writeBuffer(NativeDataOutputStream out)
throws java.io.IOException
out - the native buffered output stream.
java.io.IOException - if an IO error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||