mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FEATURE] BufferedInputStream/BufferedOutputStream
By PullRequest https://github.com/new-sashok724/Launcher/pull/72
This commit is contained in:
parent
ec7e64fdf4
commit
acf8370c54
1 changed files with 19 additions and 0 deletions
|
@ -338,23 +338,42 @@ public static Inflater newInflater() {
|
||||||
public static InputStream newInput(Path file) throws IOException {
|
public static InputStream newInput(Path file) throws IOException {
|
||||||
return Files.newInputStream(file, READ_OPTIONS);
|
return Files.newInputStream(file, READ_OPTIONS);
|
||||||
}
|
}
|
||||||
|
@LauncherAPI
|
||||||
|
public static InputStream newBufferedInput(Path file) throws IOException {
|
||||||
|
return new BufferedInputStream(Files.newInputStream(file, READ_OPTIONS));
|
||||||
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public static InputStream newInput(URL url) throws IOException {
|
public static InputStream newInput(URL url) throws IOException {
|
||||||
return newConnection(url).getInputStream();
|
return newConnection(url).getInputStream();
|
||||||
}
|
}
|
||||||
|
@LauncherAPI
|
||||||
|
public static BufferedInputStream newBufferedInput(URL url) throws IOException {
|
||||||
|
return new BufferedInputStream(newConnection(url).getInputStream());
|
||||||
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public static OutputStream newOutput(Path file) throws IOException {
|
public static OutputStream newOutput(Path file) throws IOException {
|
||||||
return newOutput(file, false);
|
return newOutput(file, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LauncherAPI
|
||||||
|
public static OutputStream newBufferedOutput(Path file) throws IOException {
|
||||||
|
return newBufferedOutput(file, false);
|
||||||
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public static OutputStream newOutput(Path file, boolean append) throws IOException {
|
public static OutputStream newOutput(Path file, boolean append) throws IOException {
|
||||||
createParentDirs(file);
|
createParentDirs(file);
|
||||||
return Files.newOutputStream(file, append ? APPEND_OPTIONS : WRITE_OPTIONS);
|
return Files.newOutputStream(file, append ? APPEND_OPTIONS : WRITE_OPTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LauncherAPI
|
||||||
|
public static OutputStream newBufferedOutput(Path file, boolean append) throws IOException {
|
||||||
|
createParentDirs(file);
|
||||||
|
return new BufferedOutputStream(Files.newOutputStream(file, append ? APPEND_OPTIONS : WRITE_OPTIONS));
|
||||||
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public static BufferedReader newReader(InputStream input) {
|
public static BufferedReader newReader(InputStream input) {
|
||||||
return newReader(input, UNICODE_CHARSET);
|
return newReader(input, UNICODE_CHARSET);
|
||||||
|
|
Loading…
Reference in a new issue