748 byte[] b = bi.toByteArray(); 749 int n = b.length; 750 if (n == len) { 751 return b; 752 } 753 if ((n == len + 1) && (b[0] == 0)) { 754 byte[] t = new byte[len]; 755 System.arraycopy(b, 1, t, 0, len); 756 return t; 757 } 758 if (n > len) { 759 return null; 760 } 761 // must be smaller 762 byte[] t = new byte[len]; 763 System.arraycopy(b, 0, t, (len - n), n); 764 return t; 765 } 766 767 // see JCA spec 768 protected void engineSetParameter(String param, Object value) 769 throws InvalidParameterException { 770 throw new UnsupportedOperationException("setParameter() not supported"); 771 } 772 773 // see JCA spec 774 protected Object engineGetParameter(String param) 775 throws InvalidParameterException { 776 throw new UnsupportedOperationException("getParameter() not supported"); 777 } 778 } | 748 byte[] b = bi.toByteArray(); 749 int n = b.length; 750 if (n == len) { 751 return b; 752 } 753 if ((n == len + 1) && (b[0] == 0)) { 754 byte[] t = new byte[len]; 755 System.arraycopy(b, 1, t, 0, len); 756 return t; 757 } 758 if (n > len) { 759 return null; 760 } 761 // must be smaller 762 byte[] t = new byte[len]; 763 System.arraycopy(b, 0, t, (len - n), n); 764 return t; 765 } 766 767 // see JCA spec 768 @SuppressWarnings("deprecation") 769 protected void engineSetParameter(String param, Object value) 770 throws InvalidParameterException { 771 throw new UnsupportedOperationException("setParameter() not supported"); 772 } 773 774 // see JCA spec 775 @SuppressWarnings("deprecation") 776 protected Object engineGetParameter(String param) 777 throws InvalidParameterException { 778 throw new UnsupportedOperationException("getParameter() not supported"); 779 } 780 } |