Package org.ujmp.core.util.io
Class IntelligentFileReader
- java.lang.Object
-
- java.io.Reader
-
- org.ujmp.core.util.io.IntelligentFileReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class IntelligentFileReader extends java.io.Reader
-
-
Constructor Summary
Constructors Constructor Description IntelligentFileReader(java.io.File file)
IntelligentFileReader(java.io.File file, java.lang.String encoding)
IntelligentFileReader(java.io.InputStream inputStream)
IntelligentFileReader(java.io.Reader reader)
IntelligentFileReader(java.lang.String file)
IntelligentFileReader(java.net.URLConnection connection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getLineNumber()
static java.lang.String
load(java.io.File filename)
static java.lang.String
load(java.io.InputStream stream)
static java.lang.String
load(java.io.Reader reader)
static java.lang.String
load(java.lang.String filename)
static java.lang.String
load(java.net.URL url)
int
read(char[] cbuf, int off, int len)
static byte[]
readBytes(java.io.File file)
static byte[]
readBytes(java.io.File file, int length)
java.lang.String
readLine()
-
-
-
Constructor Detail
-
IntelligentFileReader
public IntelligentFileReader(java.lang.String file)
-
IntelligentFileReader
public IntelligentFileReader(java.io.InputStream inputStream)
-
IntelligentFileReader
public IntelligentFileReader(java.io.Reader reader)
-
IntelligentFileReader
public IntelligentFileReader(java.io.File file)
-
IntelligentFileReader
public IntelligentFileReader(java.io.File file, java.lang.String encoding)
-
IntelligentFileReader
public IntelligentFileReader(java.net.URLConnection connection) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
readLine
public java.lang.String readLine()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Reader
-
getLineNumber
public int getLineNumber()
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
- Specified by:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
load
public static java.lang.String load(java.lang.String filename)
-
load
public static java.lang.String load(java.io.File filename)
-
load
public static java.lang.String load(java.io.InputStream stream)
-
load
public static java.lang.String load(java.io.Reader reader)
-
readBytes
public static byte[] readBytes(java.io.File file)
-
readBytes
public static byte[] readBytes(java.io.File file, int length)
-
load
public static java.lang.String load(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
-