code: private static ByteBuffer stringAsType(String content, AbstractType<?> type)
      {
          try
          {
              return type.fromString(content);
          }
          catch (MarshalException e)
          {
              throw new RuntimeException(e.getMessage());
          }
      }
docs: Convert a string to bytes (ByteBuffer) according to type
  @param content string to convert
  @param type type to use for conversion
  @return byte buffer representation of the given string