Package com.peterphi.std.io
Class StreamUtil
java.lang.Object
com.peterphi.std.io.StreamUtil
Title: Stream Utility Class
Description: Does useful things with streams
Copyright: Copyright (c) 2006
- Version:
- $Revision$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final com.peterphi.std.io.StreamUtil.DummyMonitorA monitor which does nothingstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddoBackgroundCopy(InputStream isI, OutputStream osI) static voiddoBackgroundCopy(InputStream is, OutputStream os, ICopyProgressMonitor monitor) static voiddoBackgroundCopy(InputStream is, OutputStream os, ICopyProgressMonitor monitor, boolean closeOutput, boolean closeInput) static longEats an inputstream, discarding its contentsstatic InputStreamrouteStreamThroughProcess(Process p, InputStream origin, boolean closeInput) Given a Process, this function will route the flow of data through it & out againstatic voidstreamCopy(InputStream in, OutputStream out) static voidstreamCopy(InputStream in, OutputStream out, ICopyProgressMonitor monitor) static voidstreamCopy(InputStream input, Writer output) Copies the contents of an InputStream, using the default encoding, into a Writerstatic voidstreamCopy(Reader reader, Writer writer)
-
Field Details
-
STREAM_SLEEP_TIME
public static final int STREAM_SLEEP_TIME- See Also:
-
CHUNKSIZE
public static final int CHUNKSIZE- See Also:
-
MONITOR_UPDATE_INTERVAL
public static final int MONITOR_UPDATE_INTERVAL- See Also:
-
DUMMY_MONITOR
public static final com.peterphi.std.io.StreamUtil.DummyMonitor DUMMY_MONITORA monitor which does nothing
-
-
Method Details
-
routeStreamThroughProcess
public static InputStream routeStreamThroughProcess(Process p, InputStream origin, boolean closeInput) Given a Process, this function will route the flow of data through it & out again- Parameters:
p-origin-closeInput-- Returns:
-
eatInputStream
Eats an inputstream, discarding its contents- Parameters:
is- InputStream The input stream to read to the end of- Returns:
- long The size of the stream
-
doBackgroundCopy
-
doBackgroundCopy
-
doBackgroundCopy
public static void doBackgroundCopy(InputStream is, OutputStream os, ICopyProgressMonitor monitor, boolean closeOutput, boolean closeInput) -
streamCopy
-
streamCopy
-
streamCopy
- Throws:
IOException
-
streamCopy
Copies the contents of an InputStream, using the default encoding, into a Writer- Parameters:
input-output-- Throws:
IOException
-