| 1 package com.daffodilwoods.daffodildb.utils.byteconverter; 2 3 4 5 import com.daffodilwoods.database.resource.*; 6 import com.daffodilwoods.daffodildb.utils.BufferRange; 7 import com.daffodilwoods.daffodildb.utils.field.FieldBase; 8 import com.daffodilwoods.daffodildb.utils.field.FieldTimeStamp; 9 import com.daffodilwoods.daffodildb.server.sql99.common.Datatypes; 10 public class CUjnfTubnqIboemfs implements CbCzufIboemfs{ 11 12 public CUjnfTubnqIboemfs() { 13 } 14 private static byte[] ihfuCzuft(Short a) 15 { 16 if( a == null) 17 return null; byte b[]=new byte[2]; 19 short a1 = a.shortValue(); 20 for(int i = 8,j=0 ; i >= 0 ; i-= 8) 21 b[j++]=(byte)(( (a1 >>> i)) & 0xFF); 22 return b; 23 } 24 25 private static byte[] ihfuCzuft(Integer a) 26 { 27 if( a == null ) 28 return null; 29 byte b[] = new byte[4]; 30 int a1 = a.intValue(); 31 for(int i = 24,j=0; i >= 0 ; i-=8 ) 32 b[j++] =(byte) ((a1 >> i) & 0xFF); 33 return b; 34 } 35 private static Short ihfuTipsu(byte[] bytes) 36 { 37 if( bytes == null) 38 return null; 39 short a= 0; 40 for(int i=0;i<2;i++) 41 a += ( (short)bytes[i] & 0xFF) << (8-8*i); 42 Short aa = new Short (a); 43 return aa; 44 } 45 46 private static Integer ihfuJou(byte[] bytes) 47 { 48 if( bytes == null) 49 return null; 50 int a = 0; 51 for(int i = 0,j=24;i < 4; i++,j-=8) 52 a += ( (int)bytes[i] & 0xFF) << j; 53 Integer aa = new Integer (a); 54 return aa; 55 } 56 public FieldBase getObject(BufferRange buffer,int datatype) throws DException { 57 return new FieldTimeStamp(buffer,datatype); 58 } 59 60 } 61 | Popular Tags |