public class DCEBuffer extends Object
Used to pack and unpack DCE/RPC requests/responses.
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_INT |
static int |
ALIGN_LONG |
static int |
ALIGN_NONE |
static int |
ALIGN_SHORT |
static int |
ALLOCATIONHINT |
static int |
AUTHLEN |
static int |
CALLID |
static int |
DCEDATA |
static int |
FLG_BROADCAST |
static int |
FLG_CANCEL |
static int |
FLG_FIRSTFRAG |
static int |
FLG_IDEMPOTENT |
static int |
FLG_LASTFRAG |
static int |
FLG_ONLYFRAG |
static int |
FRAGMENTLEN |
static int |
HDR_ALLOCHINT |
static int |
HDR_AUTHLEN |
static int |
HDR_CALLID |
static int |
HDR_DATAREP |
static int |
HDR_FLAGS |
static int |
HDR_FRAGLEN |
static int |
HDR_OPCODE |
static int |
HDR_PDUTYPE |
static int |
HDR_VERMAJOR |
static int |
HDR_VERMINOR |
static int |
HEADERFLAGS |
static int |
MAX_STRING_LEN |
static int |
OPERATIONDATA |
static int |
OPERATIONID |
static int |
PACKEDDATAREP |
static int |
PDUTYPE |
static int |
PRESENTIDENT |
static int |
VERSIONMAJOR |
static int |
VERSIONMINOR |
Constructor and Description |
---|
DCEBuffer()
Default constructor
|
DCEBuffer(byte[] buf,
int startPos)
Class constructor
|
DCEBuffer(byte[] buf,
int startPos,
int len)
Class constructor
|
DCEBuffer(int siz)
Class constructor
|
DCEBuffer(TransactBuffer tbuf)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
appendData(byte[] buf,
int off,
int len)
Append a raw data block to the buffer
|
int |
copyData(byte[] buf,
int off,
int cnt)
Copy data from the DCE buffer to the user buffer, and update the current read position.
|
void |
Dump()
Dump the DCE buffered data
|
int |
getAvailableLength()
Return the amount of data left to read
|
byte[] |
getBuffer()
Return the DCE buffer
|
int |
getByte(int align)
Get a byte from the buffer
|
byte[] |
getBytes(byte[] buf,
int len)
Get a block of bytes from the buffer
|
byte[] |
getByteStructure(byte[] buf)
Get a byte structure that has a header
|
String |
getCharArray()
Get a character array from the buffer
|
String |
getCharArray(int align)
Get a character array from the buffer and align on the specified boundary
|
String |
getCharArrayNotNull(String strVar,
int align)
Get a character array from the buffer if the String variable is not null, and align on the specified boundary
|
String |
getCharArrayPointer()
Get a character array header from the buffer and return either an empty string if the pointer is valid or null.
|
String |
getChars(int len)
Get a number of Unicode characters from the buffer and return as a string
|
byte[] |
getDataBlock(int align)
Get a data block from the buffer and align on the specified boundary
|
int |
getErrorStatus()
Return the error status code
|
void |
getHandle(PolicyHandle handle)
Get a handle from the buffer
|
int |
getHeaderValue(int valTyp)
Return a DCE/RPC header value
|
int |
getInt()
Get an integer from the buffer
|
int |
getLength()
Return the current used buffer length
|
long |
getLong()
Get a long (64 bit) value from the buffer
|
long |
getNTTime()
Get an NT 64bit time value.
|
int |
getPointer()
Get a pointer from the buffer
|
int |
getReadPosition()
Return the read buffer position
|
int |
getShort()
Get a short from the buffer
|
int |
getShort(int align)
Get a short from the buffer and align the read pointer
|
int |
getStatusCode()
Get the status code from the end of the data block
|
String |
getString()
Get a string from the buffer
|
String |
getString(int align)
Get a string from the buffer and align on the specified boundary
|
String |
getStringAt(int pos)
Get a string from a particular position in the buffer
|
String |
getStringNotNull(String strVar,
int align)
Get a string from the buffer if the String variable is not null, and align on the specified boundary
|
String |
getStringPointer()
Get a pointer from the buffer and return either an empty string if the pointer is valid or null.
|
int |
getUnicodeHeaderLength()
Read a Unicode string header and return the string length.
|
String |
getUnicodeString()
Get a unicode string from the current position in the buffer
|
UUID |
getUUID(boolean readVer)
Get a UUID from the buffer
|
int |
getWritePosition()
Return the write buffer position
|
boolean |
hasErrorStatus()
Determine if there is an error status set
|
boolean |
hasMoreEntries()
Check if the status indicates that there are more entries available
|
boolean |
hasSuccessStatus()
Check if the status indicates success
|
boolean |
isFirstFragment()
Determine if this is the first fragment
|
boolean |
isLastFragment()
Determine if this is the last fragment
|
boolean |
isOnlyFragment()
Determine if this is the only fragment in the request
|
void |
positionAt(int pos)
Set the read position
|
void |
putASCIIString(String str,
boolean incNul)
Append an ASCII string to the DCE buffer
|
void |
putASCIIString(String str,
boolean incNul,
int align)
Append an ASCII string to the DCE buffer, and align on the specified boundary
|
void |
putBindAckHeader(int callid)
Append a bind acknowlegde header to the buffer
|
void |
putBindHeader(int callid)
Append a bind header to the buffer
|
void |
putBuffer(DCEBuffer buf)
Append a DCE buffer to the current DCE buffer
|
void |
putByte(byte bval,
int align)
Append a byte value to the buffer and align to the specified boundary
|
void |
putByte(int bval)
Append a byte value to the buffer
|
void |
putByte(int bval,
int align)
Append a byte value to the buffer and align to the specified boundary
|
void |
putBytes(byte[] bval,
int len)
Append a block of bytes to the buffer
|
void |
putBytes(byte[] bval,
int len,
int align)
Append a block of bytes to the buffer
|
void |
putErrorStatus(int sts)
Append an error status to the buffer, also sets the error status value
|
void |
putHandle(PolicyHandle handle)
Append a policy handle to the buffer
|
void |
putHeader(int pdutyp,
int callid)
Append a DCE header to the buffer
|
void |
putInt(int ival)
Append an integer to the buffer
|
void |
putPointer(boolean notNull)
Append a pointer to the buffer.
|
void |
putPointer(Object obj)
Append a pointer to the buffer.
|
void |
putRequestHeader(int callid,
int opcode,
int allocHint)
Append a request header to the buffer
|
void |
putResponseHeader(int callid,
int allocHint)
Append a response header to the buffer
|
void |
putShort(int sval)
Append a short value to the buffer
|
void |
putString(String str)
Append a DCE string to the buffer
|
void |
putString(String str,
int align)
Append a DCE string to the buffer and align to the specified boundary
|
void |
putString(String str,
int align,
boolean incNul)
Append a DCE string to the buffer, specify whether the nul is included in the string length or not
|
void |
putStringReturn(int len,
int align)
Append string return buffer details.
|
void |
putUnicodeBytes(String str,
int align)
Append Unicode characters to the buffer
|
void |
putUnicodeHeader(int len)
Append a DCE string header to the buffer
|
void |
putUnicodeHeader(String str,
boolean incNul)
Append a DCE string header to the buffer
|
void |
putUnicodeReturn(int len)
Append a Unicode return string header to the buffer.
|
void |
putUUID(UUID uuid,
boolean writeVer)
Append a UUID to the buffer
|
void |
putZeroInts(int cnt)
Append zero integers to the buffer
|
void |
resetBuffer()
Reset the buffer pointers to reuse the buffer
|
void |
setErrorStatus(int sts)
Set the error status code
|
void |
setHeaderValue(int typ,
int val)
Set a DCE/RPC header value
|
void |
setWritePosition(int pos)
Set the new write position
|
void |
skipBytes(int cnt)
Skip over a number of bytes
|
void |
skipPointer()
Skip over a pointer
|
void |
updateWritePosition(int len)
Update the write position by the specified amount
|
public static final int HDR_VERMAJOR
public static final int HDR_VERMINOR
public static final int HDR_PDUTYPE
public static final int HDR_FLAGS
public static final int HDR_DATAREP
public static final int HDR_FRAGLEN
public static final int HDR_AUTHLEN
public static final int HDR_CALLID
public static final int HDR_ALLOCHINT
public static final int HDR_OPCODE
public static final int FLG_FIRSTFRAG
public static final int FLG_LASTFRAG
public static final int FLG_CANCEL
public static final int FLG_IDEMPOTENT
public static final int FLG_BROADCAST
public static final int FLG_ONLYFRAG
public static final int VERSIONMAJOR
public static final int VERSIONMINOR
public static final int PDUTYPE
public static final int HEADERFLAGS
public static final int PACKEDDATAREP
public static final int FRAGMENTLEN
public static final int AUTHLEN
public static final int CALLID
public static final int DCEDATA
public static final int ALLOCATIONHINT
public static final int PRESENTIDENT
public static final int OPERATIONID
public static final int OPERATIONDATA
public static final int ALIGN_NONE
public static final int ALIGN_SHORT
public static final int ALIGN_INT
public static final int ALIGN_LONG
public static final int MAX_STRING_LEN
public DCEBuffer()
public DCEBuffer(int siz)
siz
- intpublic DCEBuffer(byte[] buf, int startPos, int len)
buf
- byte[]startPos
- intlen
- intpublic DCEBuffer(byte[] buf, int startPos)
buf
- byte[]startPos
- intpublic DCEBuffer(TransactBuffer tbuf)
tbuf
- TransactBufferpublic final byte[] getBuffer()
public final int getLength()
public final int getReadPosition()
public final int getWritePosition()
public final int getAvailableLength()
public final int getByte(int align) throws DCEBufferException
align
- intDCEBufferException
public final byte[] getBytes(byte[] buf, int len) throws DCEBufferException
buf
- byte[]len
- intDCEBufferException
public final int getShort() throws DCEBufferException
DCEBufferException
public final int getShort(int align) throws DCEBufferException
align
- intDCEBufferException
public final int getInt() throws DCEBufferException
DCEBufferException
public final int getPointer() throws DCEBufferException
DCEBufferException
public final String getStringPointer() throws DCEBufferException
DCEBufferException
public final String getCharArrayPointer() throws DCEBufferException
DCEBufferException
public final String getCharArrayNotNull(String strVar, int align) throws DCEBufferException
strVar
- Stringalign
- intDCEBufferException
public final long getLong() throws DCEBufferException
DCEBufferException
public final int getHeaderValue(int valTyp)
valTyp
- intpublic final void setHeaderValue(int typ, int val)
typ
- intval
- intpublic final boolean isFirstFragment()
public final boolean isLastFragment()
public final boolean isOnlyFragment()
public final boolean hasMoreEntries()
public final boolean hasSuccessStatus()
public final void skipBytes(int cnt) throws DCEBufferException
cnt
- intDCEBufferException
public final void skipPointer() throws DCEBufferException
DCEBufferException
public final void positionAt(int pos) throws DCEBufferException
pos
- intDCEBufferException
public final String getChars(int len) throws DCEBufferException
len
- intDCEBufferException
public final int getStatusCode()
public final String getString() throws DCEBufferException
DCEBufferException
public final String getCharArray() throws DCEBufferException
DCEBufferException
public final String getCharArray(int align) throws DCEBufferException
align
- intDCEBufferException
public final String getString(int align) throws DCEBufferException
align
- intDCEBufferException
public final String getStringNotNull(String strVar, int align) throws DCEBufferException
strVar
- Stringalign
- intDCEBufferException
public final String getStringAt(int pos) throws DCEBufferException
pos
- intDCEBufferException
public final int getUnicodeHeaderLength() throws DCEBufferException
DCEBufferException
public final String getUnicodeString() throws DCEBufferException
DCEBufferException
public final byte[] getDataBlock(int align) throws DCEBufferException
align
- intDCEBufferException
public final UUID getUUID(boolean readVer) throws DCEBufferException
readVer
- booleanDCEBufferException
public final long getNTTime() throws DCEBufferException
DCEBufferException
public final byte[] getByteStructure(byte[] buf) throws DCEBufferException
buf
- byte[]DCEBufferException
public final void getHandle(PolicyHandle handle) throws DCEBufferException
handle
- PolicyHandleDCEBufferException
public final int copyData(byte[] buf, int off, int cnt) throws DCEBufferException
buf
- byte[]off
- intcnt
- intDCEBufferException
public final void appendData(byte[] buf, int off, int len) throws DCEBufferException
buf
- byte[]off
- intlen
- intDCEBufferException
public final void putInt(int ival)
ival
- intpublic final void putByte(int bval)
bval
- intpublic final void putByte(byte bval, int align)
bval
- bytealign
- intpublic final void putByte(int bval, int align)
bval
- intalign
- intpublic final void putBytes(byte[] bval, int len)
bval
- byte[]len
- intpublic final void putBytes(byte[] bval, int len, int align)
bval
- byte[]len
- intalign
- intpublic final void putShort(int sval)
sval
- intpublic final void putString(String str)
str
- Stringpublic final void putString(String str, int align)
str
- Stringalign
- intpublic final void putString(String str, int align, boolean incNul)
str
- Stringalign
- intincNul
- booleanpublic final void putStringReturn(int len, int align)
len
- intalign
- intpublic final void putUnicodeHeader(String str, boolean incNul)
str
- StringincNul
- booleanpublic final void putUnicodeReturn(int len)
len
- intpublic final void putUnicodeHeader(int len)
len
- intpublic final void putUnicodeBytes(String str, int align)
str
- Stringalign
- intpublic final void putASCIIString(String str, boolean incNul)
str
- StringincNul
- booleanpublic final void putASCIIString(String str, boolean incNul, int align)
str
- StringincNul
- booleanalign
- intpublic final void putPointer(Object obj)
obj
- Objectpublic final void putPointer(boolean notNull)
notNull
- booleanpublic final void putUUID(UUID uuid, boolean writeVer)
uuid
- UUIDwriteVer
- booleanpublic final void putHandle(PolicyHandle handle)
handle
- PolicyHandlepublic final void putBuffer(DCEBuffer buf)
buf
- DCEBufferpublic final void putErrorStatus(int sts)
sts
- intpublic final void putHeader(int pdutyp, int callid)
pdutyp
- intcallid
- intpublic final void putBindHeader(int callid)
callid
- intpublic final void putBindAckHeader(int callid)
callid
- intpublic final void putRequestHeader(int callid, int opcode, int allocHint)
callid
- intopcode
- intallocHint
- intpublic final void putResponseHeader(int callid, int allocHint)
callid
- intallocHint
- intpublic final void putZeroInts(int cnt)
cnt
- intpublic final void resetBuffer()
public final void setWritePosition(int pos)
pos
- intpublic final void updateWritePosition(int len)
len
- intpublic final boolean hasErrorStatus()
public final int getErrorStatus()
public final void setErrorStatus(int sts)
sts
- intpublic final void Dump()
Copyright © 2005–2018 Alfresco Software. All rights reserved.