Codota Logo
IOUtils
Code IndexAdd Codota to your IDE (free)

How to use
IOUtils
in
org.apache.sanselan.util

Best Java code snippets using org.apache.sanselan.util.IOUtils (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: Haehnchen/idea-php-symfony2-plugin

@Override
public void build(@NotNull Project project, @NotNull Collection<FileObject> fileObjects) {
  Collection<InputStream> memoryCache = new ArrayList<>();
  for (FileObject fileObject : fileObjects) {
    InputStream inputStream;
    try {
      // copy stream
      inputStream = new ResetOnCloseInputStream(new ByteArrayInputStream(
        IOUtils.getInputStreamBytes(fileObject.getContent().getInputStream()))
      );
    } catch (FileSystemException ignored) {
      continue;
    } catch (IOException ignored) {
      continue;
    }
    memoryCache.add(inputStream);
  }
  storage = new ServiceParameterStorage(memoryCache);
}
origin: org.apache.sanselan/sanselan

public static void copyStreamToStream(InputStream src, OutputStream dst)
    throws IOException
{
  copyStreamToStream(src, dst, true);
}
origin: org.apache.sanselan/sanselan

public static void writeToFile(byte[] src, File file) throws IOException
{
  ByteArrayInputStream stream = null;
  try
  {
    stream = new ByteArrayInputStream(src);
    putInputStreamToFile(stream, file);
  } finally
  {
    try
    {
      if (stream != null)
        stream.close();
    } catch (Exception e)
    {
      Debug.debug(e);
    }
  }
}
origin: liias/monkey

@NotNull
private Map<MonkeyType, MonkeyType> readSettingsFile(File settingsFile) throws IOException {
 byte[] fileBytes = IOUtils.getFileBytes(settingsFile);
 Deserializer deserializer = new Deserializer(fileBytes);
 Optional<MonkeyTypeHash> settings = deserializer.getTypes()
  .stream()
  .filter(monkeyType -> monkeyType instanceof MonkeyTypeHash)
  .map(monkeyType -> (MonkeyTypeHash) monkeyType)
  .findFirst();
 return settings.map(MonkeyTypeHash::getItems).orElse(new HashMap<>());
}
origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt

public static void writeToFile(byte[] src, File file) throws IOException
{
  ByteArrayInputStream stream = null;
  try
  {
    stream = new ByteArrayInputStream(src);
    putInputStreamToFile(stream, file);
  } finally
  {
    try
    {
      if (stream != null)
        stream.close();
    } catch (Exception e)
    {
      Debug.debug(e);
    }
  }
}
origin: org.apache.sanselan/sanselan

/**
 * Reads a File into memory.
 * <p>
 * 
 * @param file
 *            The File to read.
 * @return A byte array containing the contents of the File
 * @see InputStream
 */
public static byte[] getFileBytes(File file) throws IOException
{
  InputStream is = null;
  try
  {
    is = new FileInputStream(file);
    return getInputStreamBytes(is);
  } finally
  {
    try
    {
      if (is != null)
        is.close();
    } catch (IOException e)
    {
      Debug.debug(e);
    }
  }
}
origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt

public static void copyStreamToStream(InputStream src, OutputStream dst)
    throws IOException
{
  copyStreamToStream(src, dst, true);
}
origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt

/**
 * Reads a File into memory.
 * <p>
 *
 * @param file
 *            The File to read.
 * @return A byte array containing the contents of the File
 * @see InputStream
 */
public static byte[] getFileBytes(File file) throws IOException
{
  InputStream is = null;
  try
  {
    is = new FileInputStream(file);
    return getInputStreamBytes(is);
  } finally
  {
    try
    {
      if (is != null)
        is.close();
    } catch (IOException e)
    {
      Debug.debug(e);
    }
  }
}
origin: org.apache.sanselan/sanselan

public static void putInputStreamToFile(InputStream src, File file)
    throws IOException
{
  FileOutputStream stream = null;
  try
  {
    if (file.getParentFile() != null)
      file.getParentFile().mkdirs();
    stream = new FileOutputStream(file);
    copyStreamToStream(src, stream);
  } finally
  {
    try
    {
      if (stream != null)
        stream.close();
    } catch (Exception e)
    {
      Debug.debug(e);
    }
  }
}
origin: fr.opensagres.xdocreport.appengine-awt/appengine-awt

public static void putInputStreamToFile(InputStream src, File file)
    throws IOException
{
  FileOutputStream stream = null;
  try
  {
    if (file.getParentFile() != null)
      file.getParentFile().mkdirs();
    stream = new FileOutputStream(file);
    copyStreamToStream(src, stream);
  } finally
  {
    try
    {
      if (stream != null)
        stream.close();
    } catch (Exception e)
    {
      Debug.debug(e);
    }
  }
}
org.apache.sanselan.utilIOUtils

Most used methods

  • getInputStreamBytes
    Reads an InputStream to the end.
  • copyStreamToStream
  • putInputStreamToFile
  • getFileBytes
    Reads a File into memory.

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • onRequestPermissionsResult (Fragment)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ImageIO (javax.imageio)
  • JFrame (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now