以下代码是ojdbc5.jar的反编译源码: T4CMAREngine.class
int unmarshalUB2() throws SQLException, IOException
{
int i = (int)buffer2Value((byte)1);
return i & 0xFFFF;
}
//buffer2Value的代码怎么理解? 作用是什么?
// T4CSocketInputStreamWrapper inStream; //类成员变量
// T4CTypeRep types;//类成员变量
final long buffer2Value(byte paramByte) throws SQLException, IOException
{
long l = 0L;
int i = 1;
if ((types.rep[paramByte] & 0x1) > 0){
i = inStream.readB1();
}
else {
switch (paramByte){
case 1: i = 2;break;
case 2: i = 4;break;
case 3: i = 8;
}
}
if ((types.rep[paramByte] & 0x2) > 0) {
l = inStream.readLongLSB(i);
} else {
l = inStream.readLongMSB(i);
}
return l;
}