Package org.python.core.util
Class FileUtil
- java.lang.Object
-
- org.python.core.util.FileUtil
-
public class FileUtil extends java.lang.ObjectUtility methods for Java file handling.
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]readBytes(java.io.InputStream in)Read all bytes from the input stream.static PyFilewrap(java.io.InputStream is)Creates a PyFile in text mode that reads from the givenInputStream.static PyFilewrap(java.io.InputStream is, int bufsize)Creates a PyFile in text mode that reads from the givenInputStreamusing bufsize.static PyFilewrap(java.io.InputStream is, java.lang.String mode)Creates a PyFile with mode that reads from theInputStream.static PyFilewrap(java.io.InputStream is, java.lang.String mode, int bufsize)Creates a PyFile with mode that reads from the givenInputStreamusing bufsize.static PyFilewrap(java.io.OutputStream os)Creates a PyFile in text mode that writes to the givenOutputStream.static PyFilewrap(java.io.OutputStream os, int bufsize)Creates a PyFile in text mode that writes to the givenOutputStreamwith bufsize.static PyFilewrap(java.io.OutputStream os, java.lang.String mode)Creates a PyFile with mode that writes to the givenOutputStreamstatic PyFilewrap(java.io.OutputStream os, java.lang.String mode, int bufsize)Creates a PyFile with mode that writes to the givenOutputStreamwith the given bufsize.
-
-
-
Method Detail
-
wrap
public static PyFile wrap(java.io.InputStream is, java.lang.String mode, int bufsize)
Creates a PyFile with mode that reads from the givenInputStreamusing bufsize.
-
wrap
public static PyFile wrap(java.io.InputStream is, java.lang.String mode)
Creates a PyFile with mode that reads from theInputStream.
-
wrap
public static PyFile wrap(java.io.InputStream is, int bufsize)
Creates a PyFile in text mode that reads from the givenInputStreamusing bufsize.
-
wrap
public static PyFile wrap(java.io.InputStream is)
Creates a PyFile in text mode that reads from the givenInputStream.
-
wrap
public static PyFile wrap(java.io.OutputStream os, java.lang.String mode, int bufsize)
Creates a PyFile with mode that writes to the givenOutputStreamwith the given bufsize.
-
wrap
public static PyFile wrap(java.io.OutputStream os, java.lang.String mode)
Creates a PyFile with mode that writes to the givenOutputStream
-
wrap
public static PyFile wrap(java.io.OutputStream os, int bufsize)
Creates a PyFile in text mode that writes to the givenOutputStreamwith bufsize.
-
wrap
public static PyFile wrap(java.io.OutputStream os)
Creates a PyFile in text mode that writes to the givenOutputStream.
-
readBytes
public static byte[] readBytes(java.io.InputStream in) throws java.io.IOExceptionRead all bytes from the input stream. Note that using this method to read very large streams could cause out-of-memory exceptions and/or block for large periods of time.- Throws:
java.io.IOException
-
-