func putString(log logger.T, byteArray []byte, offsetStart int, offsetEnd int, inputString string) (err error) {
	byteArrayLength := len(byteArray)
	if offsetStart > byteArrayLength-1 || offsetEnd > byteArrayLength-1 || offsetStart > offsetEnd || offsetStart < 0 {
		log.Error("putString failed: Offset is invalid.")
		return errors.New("Offset is outside the byte array.")
	}

	if offsetEnd-offsetStart+1 < len(inputString) {
		log.Error("putString failed: Not enough space to save the string.")
		return errors.New("Not enough space to save the string.")
	}

	// wipe out the array location first and then insert the new value.
	for i := offsetStart; i <= offsetEnd; i++ {
		byteArray[i] = ' '
	}

	copy(byteArray[offsetStart:offsetEnd+1], inputString)
	return nil
}
// putString puts a string value to a byte array starting from the specified offset.
putString puts a string value to a byte array starting from the specified offset.
// putString puts a string value to a byte array starting from the specified offset .
func putString(log logger.T, byteArray []byte, offsetStart int, offsetEnd int, inputString string) (err error) {
	byteArrayLength := len(byteArray)
	if offsetStart > byteArrayLength-1 || offsetEnd > byteArrayLength-1 || offsetStart > offsetEnd || offsetStart < 0 {
		log.Error("putString failed: Offset is invalid.")
		return errors.New("Offset is outside the byte array.")
	}
	if offsetEnd-offsetStart+1 < len(inputString) {
		log.Error("putString failed: Not enough space to save the string.")
		return errors.New("Not enough space to save the string.")
	}
	for i := offsetStart; i <= offsetEnd; i++ {
		byteArray[i] = ' '
	}
	copy(byteArray[offsetStart:offsetEnd+1], inputString)
	return nil
}
func putString ( log logger . T , byteArray [ ] byte , offsetStart int , offsetEnd int , inputString string ) ( err error ) { byteArrayLength := len ( byteArray ) if offsetStart > byteArrayLength - 1 || offsetEnd > byteArrayLength - 1 || offsetStart > offsetEnd || offsetStart < 0 { log . Error ( " " ) return errors . New ( " " ) } if offsetEnd - offsetStart + 1 < len ( inputString ) { log . Error ( " " ) return errors . New ( " " ) } for i := offsetStart ; i <= offsetEnd ; i ++ { byteArray [ i ] = ' ' } copy ( byteArray [ offsetStart : offsetEnd + 1 ] , inputString ) return nil }
putString puts a string value to a byte array starting from the specified offset.
putString puts a string value to a byte array starting from the specified offset .
// wipe out the array location first and then insert the new value.