package tv.ouya.console.internal.util;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.text.NumberFormat;
import java.util.Collection;
import java.util.Locale;

public class Strings
{
  public static InputStream asStream(String paramString)
  {
    return new ByteArrayInputStream(paramString.getBytes());
  }
  
  public static String formatDollarAmount(int paramInt)
  {
    NumberFormat localNumberFormat = NumberFormat.getCurrencyInstance(Locale.US);
    return "$" + localNumberFormat.format(paramInt / 100.0F).substring(1);
  }
  
  public static String fromFile(String paramString)
  {
    try
    {
      paramString = fromStream(new FileInputStream(paramString));
      return paramString;
    }
    catch (IOException paramString)
    {
      throw new RuntimeException(paramString);
    }
  }
  
  public static String fromStream(InputStream paramInputStream)
    throws IOException
  {
    char[] arrayOfChar = new char[65536];
    StringBuilder localStringBuilder = new StringBuilder();
    InputStreamReader localInputStreamReader = new InputStreamReader(paramInputStream, "UTF-8");
    try
    {
      for (;;)
      {
        int i = localInputStreamReader.read(arrayOfChar, 0, arrayOfChar.length);
        if (i <= 0) {
          break;
        }
        localStringBuilder.append(arrayOfChar, 0, i);
      }
      str = localStringBuilder.toString();
    }
    finally
    {
      localInputStreamReader.close();
      paramInputStream.close();
    }
    String str;
    localInputStreamReader.close();
    paramInputStream.close();
    return str;
  }
  
  public static boolean hasLength(String paramString)
  {
    return (paramString != null) && (paramString.length() > 0);
  }
  
  public static boolean isEmptyOrWhitespace(String paramString)
  {
    return (paramString == null) || (paramString.trim().length() == 0);
  }
  
  public static String join(String paramString, Collection paramCollection)
  {
    return join(paramString, paramCollection.toArray());
  }
  
  public static String join(String paramString, Object... paramVarArgs)
  {
    Object localObject1 = "";
    StringBuilder localStringBuilder = new StringBuilder();
    int j = paramVarArgs.length;
    int i = 0;
    if (i < j)
    {
      Object localObject2 = paramVarArgs[i];
      if (localObject2 == null) {}
      for (localObject2 = null;; localObject2 = localObject2.toString())
      {
        Object localObject3 = localObject1;
        if (localObject2 != null)
        {
          localObject3 = localObject1;
          if (((String)localObject2).length() > 0)
          {
            localStringBuilder.append((String)localObject1).append((String)localObject2);
            localObject3 = paramString;
          }
        }
        i += 1;
        localObject1 = localObject3;
        break;
      }
    }
    return localStringBuilder.toString();
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/tv/ouya/console/internal/util/Strings.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */