public static byte [ ] encodeSingle ( byte [ ] value , int prefixPadding , int suffixPadding ) { if ( prefixPadding <= 0 && suffixPadding <= 0 ) { return value ; } int length = value . length ; byte [ ] dst = new byte [ prefixPadding + length + suffixPadding ] ; System . arraycopy ( value , 0 , dst , prefixPadding , length ) ; return dst ; }
Encodes the given byte array for use when there is only a single property whose type is a byte array . The original byte array is returned if the padding lengths are zero .