|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.common.util.IOUtil
public class IOUtil
| Method Summary | |
|---|---|
static byte[] |
copyStream2ByteArray(InputStream stream)
Copy the specified input stream to a byte array, which is being returned. |
static ByteBuffer |
copyStream2ByteBuffer(InputStream stream)
Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned. |
static int |
copyStream2Stream(InputStream in,
OutputStream out,
int totalNumBytes)
Copy the specified input stream to the specified output stream. |
static int |
copyURL2File(URL url,
File outFile)
Copy the specified input stream to the specified output file. |
static String |
getFileSuffix(File file)
Returns the lowercase suffix of the given file name (the text after the last '.' in the file name). |
static String |
getFileSuffix(String filename)
Returns the lowercase suffix of the given file name (the text after the last '.' in the file name). |
static String |
getRelativeOf(File baseLocation,
String relativeFile)
Generates a path for the 'relativeFile' relative to the 'baseLocation'. |
static String |
getRelativeOf(URL baseLocation,
String relativeFile)
Generates a path for the 'relativeFile' relative to the 'baseLocation'. |
static URL |
getResource(Class context,
String resourcePath)
Locating a resource using 'getResource(String path, ClassLoader cl)', with the given context's ClassLoader and the resourcePath as is, as well with the context's package name-path plus the resourcePath. |
static URL |
getResource(String resourcePath,
ClassLoader cl)
Locating a resource using the ClassLoader's facility if not null, the absolute URL and absolute file. |
static boolean |
urlExists(URL url)
Returns true, if the URL exists and a connection could be opened. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int copyURL2File(URL url,
File outFile)
throws IOException
IOException
public static int copyStream2Stream(InputStream in,
OutputStream out,
int totalNumBytes)
throws IOException
IOException
public static byte[] copyStream2ByteArray(InputStream stream)
throws IOException
IOException
public static ByteBuffer copyStream2ByteBuffer(InputStream stream)
throws IOException
The implementation creates the ByteBuffer w/ copyStream2ByteArray(InputStream)'s returned byte array.
IOExceptionpublic static String getFileSuffix(File file)
file - name of the file
NullPointerException - if file is nullpublic static String getFileSuffix(String filename)
filename - name of the file
NullPointerException - if filename is null
public static URL getResource(Class context,
String resourcePath)
getResource(String, ClassLoader)
public static URL getResource(String resourcePath,
ClassLoader cl)
ClassLoader.getResource(String),
ClassLoader.getSystemResource(String),
URL.URL(String),
File.File(String)
public static String getRelativeOf(File baseLocation,
String relativeFile)
baseLocation - denotes a directoryrelativeFile - denotes a relative file to the baseLocation
public static String getRelativeOf(URL baseLocation,
String relativeFile)
baseLocation - denotes a URL to a filerelativeFile - denotes a relative file to the baseLocation's parent directorypublic static boolean urlExists(URL url)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||