// Path: core/src/main/java/fixio/Utils.java
// public class Utils {
// 
//     private Utils() {
//     }
// 
//     /**
//      * Converts a String to ASCII byte array, provided that string contains only ASCII characters.
//      *
//      * @param str string to convert
//      * @return a byte array
//      * @see <a href="http://www.javacodegeeks.com/2010/11/java-best-practices-char-to-byte-and.html">Java Best Practices char to byte</a>
//      */
//     public static byte[] stringToBytesASCII(String str) {
//         char[] buffer = str.toCharArray();
//         final int length = buffer.length;
//         byte[] b = new byte[length];
//         for (int i = 0; i < length; i++) {
//             b[i] = (byte) buffer[i];
//         }
//         return b;
//     }
// 
//     /**
//      * Converts ASCII byte array to String, provided that string contains only ASCII characters.
//      *
//      * @param bytes a byte array tp convert
//      * @return converted String
//      * @see <a href="http://www.javacodegeeks.com/2010/11/java-best-practices-char-to-byte-and.html">Java Best Practices char to byte</a>
//      */
//     public static String bytesToStringASCII(byte[] bytes) {
//         final int length = bytes.length;
//         char[] buffer = new char[length];
//         for (int i = 0; i < length; i++) {
//             buffer[i] = (char) bytes[i];
//         }
//         return new String(buffer);
//     }
// 
// }


import fixio.Utils;
import java.util.Arrays;
/*
 * Copyright 2014 The FIX.io Project
 *
 * The FIX.io Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package fixio.fixprotocol.fields;



public class StringField extends AbstractField<String> {

    private final byte[] value;

    public StringField(int tagNum, String value) {
        super(tagNum);
// Path: core/src/main/java/fixio/Utils.java
// public class Utils {
// 
//     private Utils() {
//     }
// 
//     /**
//      * Converts a String to ASCII byte array, provided that string contains only ASCII characters.
//      *
//      * @param str string to convert
//      * @return a byte array
//      * @see <a href="http://www.javacodegeeks.com/2010/11/java-best-practices-char-to-byte-and.html">Java Best Practices char to byte</a>
//      */
//     public static byte[] stringToBytesASCII(String str) {
//         char[] buffer = str.toCharArray();
//         final int length = buffer.length;
//         byte[] b = new byte[length];
//         for (int i = 0; i < length; i++) {
//             b[i] = (byte) buffer[i];
//         }
//         return b;
//     }
// 
//     /**
//      * Converts ASCII byte array to String, provided that string contains only ASCII characters.
//      *
//      * @param bytes a byte array tp convert
//      * @return converted String
//      * @see <a href="http://www.javacodegeeks.com/2010/11/java-best-practices-char-to-byte-and.html">Java Best Practices char to byte</a>
//      */
//     public static String bytesToStringASCII(byte[] bytes) {
//         final int length = bytes.length;
//         char[] buffer = new char[length];
//         for (int i = 0; i < length; i++) {
//             buffer[i] = (char) bytes[i];
//         }
//         return new String(buffer);
//     }
// 
// }


// Path: core/src/main/java/fixio/fixprotocol/fields/StringField.java
import fixio.Utils;
import java.util.Arrays;

/*
 * Copyright 2014 The FIX.io Project
 *
 * The FIX.io Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package fixio.fixprotocol.fields;



public class StringField extends AbstractField<String> {

    private final byte[] value;

    public StringField(int tagNum, String value) {
        super(tagNum);
        this.value = Utils.stringToBytesASCII(value);