private static String convertFieldValueToString ( final JBBPAbstractArrayField < ? > field ) { final StringBuilder result ; if ( field instanceof JBBPFieldArrayBit ) { final JBBPFieldArrayBit array = ( JBBPFieldArrayBit ) field ; result = new StringBuilder ( array . size ( ) ) ; for ( final byte b : array . getArray ( ) ) { result . append ( ( char ) ( b & 0xFF ) ) ; } } else if ( field instanceof JBBPFieldArrayByte ) { final JBBPFieldArrayByte array = ( JBBPFieldArrayByte ) field ; result = new StringBuilder ( array . size ( ) ) ; for ( final byte b : array . getArray ( ) ) { result . append ( ( char ) ( b & 0xFF ) ) ; } } else if ( field instanceof JBBPFieldArrayUByte ) { final JBBPFieldArrayUByte array = ( JBBPFieldArrayUByte ) field ; result = new StringBuilder ( array . size ( ) ) ; for ( final byte b : array . getArray ( ) ) { result . append ( ( char ) ( b & 0xFF ) ) ; } } else if ( field instanceof JBBPFieldArrayShort ) { final JBBPFieldArrayShort array = ( JBBPFieldArrayShort ) field ; result = new StringBuilder ( array . size ( ) ) ; for ( final short b : array . getArray ( ) ) { result . append ( ( char ) b ) ; } } else if ( field instanceof JBBPFieldArrayUShort ) { final JBBPFieldArrayUShort array = ( JBBPFieldArrayUShort ) field ; result = new StringBuilder ( array . size ( ) ) ; for ( final short b : array . getArray ( ) ) { result . append ( ( char ) b ) ; } } else { result = null ; } return result == null ? null : result . toString ( ) ; }
Convert an array field into its string representation .