Java Utililty Methods Dump Stream

List of utility methods to do Dump Stream

  1. HOME
  2. Java
  3. D
  4. Dump Stream

Description

The list of methods to do Dump Stream are organized into topic(s).

Method

void dump(final InputStream input)
Dump output coming from the stream
final int streamBufferSize = 1000;
new Thread(new Runnable() {
 public void run() {
 try {
 byte[] b = new byte[streamBufferSize];
 while ((input.read(b)) != -1) {
 } catch (IOException e) {
...
long dump(InputStream inputStream, OutputStream out)
dump
long total = 0;
int read;
int bufferSize = 8192;
byte[] buffer = new byte[bufferSize];
while ((read = inputStream.read(buffer, 0, bufferSize)) > -1) {
 out.write(buffer, 0, read);
 total += read;
out.flush();
return total;
void dump(InputStream is, File to)
dump the stream given to the given file
FileOutputStream fos = new FileOutputStream(to);
byte[] r = new byte[1024];
int size;
while ((size = is.read(r)) > 0) {
 fos.write(r, 0, size);
fos.close();
void dump(PrintStream p, String indent, String s)
dump
try {
 boolean expanded = s.length() > 60;
 if (needsCDATA(s)) {
 if (expanded) {
 p.println("<![CDATA[");
 p.println(s);
 p.println("]]>");
 } else {
...
void dumparr(Object[] arr, PrintStream out, boolean term)
dumparr
out.print('[');
boolean f = true;
for (Object o : arr) {
 if (!f)
 out.print(", ");
 f = false;
 if (o instanceof Object[])
 dumparr((Object[]) o, out, false);
...
void dumpArray(PrintStream out, Object[] array)
dump Array
out.print("{ ");
for (int i = 0; i < array.length; i++) {
 out.print(array[i].toString());
 if (i != (array.length - 1)) {
 out.print(", ");
out.print(" }");
...
void dumpEvent(String event, OutputStream stream)
dump an array of bytes to an OutputStream
stream.write(event.getBytes());
stream.write(EOL.getBytes());
void dumpFile(InputStream file, String header, String testName)
dump File
dumpFile(System.out, file, header, testName);
void dumpFile(JarInputStream jin, File targetFile)
Reads an entry from a JarInputStream and stores it in the given targetFile.
OutputStream out = new FileOutputStream(targetFile);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = jin.read(buffer, 0, buffer.length)) != -1) {
 out.write(buffer, 0, len);
out.flush();
out.close();
...
boolean dumpFile(String r_file, OutputStream outputstream)
dump File
byte abyte0[] = new byte[4096];
boolean flag = true;
FileInputStream fiStream = null;
try {
 fiStream = new FileInputStream(r_file);
 int i;
 while ((i = fiStream.read(abyte0)) != -1)
 outputstream.write(abyte0, 0, i);
...


AltStyle によって変換されたページ (->オリジナル) /