public class InputStreams extends Object
| Constructor and Description |
|---|
InputStreams() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
readBytes(InputStream is)
read all to bytes and close, return empty if stream is null
|
static void |
readBytes(OutputStream os,
InputStream is)
read all to output stream and close
|
static @NotNull List<String> |
readLine(InputStream is)
read all as lines to list and close
|
static @NotNull List<String> |
readLine(InputStream is,
Charset cs)
read all as lines and close
|
static void |
readLine(List<String> out,
InputStream is,
Charset cs)
read all as lines to list and close
|
static @NotNull String |
readText(InputStream is)
read all to string and close
|
static @NotNull String |
readText(InputStream is,
Charset cs)
read all to string and close
|
static void |
readText(StringBuilder sb,
InputStream is,
Charset cs)
read all to builder and close
|
static void |
saveFile(InputStream is,
File file)
write to file and close
|
static @NotNull File |
saveTemp(InputStream is)
write to temp file with prefix `mirana-` and close
|
static @NotNull File |
saveTemp(InputStream is,
String prefix)
write to temp file with prefix and close
|
static @NotNull File |
saveTemp(InputStream is,
String prefix,
boolean delOnExit)
write to temp file with prefix and close, whether delete it on jvm exit
|
public static byte[] readBytes(InputStream is)
public static void readBytes(OutputStream os, InputStream is)
@NotNull public static @NotNull String readText(InputStream is, Charset cs)
public static void readText(StringBuilder sb, InputStream is, Charset cs)
@NotNull public static @NotNull String readText(InputStream is)
@NotNull public static @NotNull List<String> readLine(InputStream is, Charset cs)
public static void readLine(List<String> out, InputStream is, Charset cs)
@NotNull public static @NotNull List<String> readLine(InputStream is)
public static void saveFile(InputStream is, File file)
@NotNull public static @NotNull File saveTemp(InputStream is, String prefix, boolean delOnExit)
@NotNull public static @NotNull File saveTemp(InputStream is, String prefix)
@NotNull public static @NotNull File saveTemp(InputStream is)
Copyright © 2023. All rights reserved.