/**
* Tries to parse the given string into an int, returning <code>-1</code> if
* the string can not be parsed.
/**
* Tries to parse the given string into an int, returning <code>-1</code> if
* the string can not be parsed.
/**
* Tries to parse the given string into an int, returning
* <code>defaultValue</code> if the string can not be parsed.
/**
* Tries to parse the given string into an int, returning
* <code>defaultValue</code> if the string can not be parsed.
/**
* Tries to parse the given string into an long, returning <code>-1</code>
* if the string can not be parsed.
/**
* Tries to parse the given string into an long, returning <code>-1</code>
* if the string can not be parsed.
/**
* Tries to parse the given string into an long, returning
* <code>defaultValue</code> if the string can not be parsed.
/**
* Tries to parse the given string into an long, returning
* <code>defaultValue</code> if the string can not be parsed.
* Copies as many bytes as possible (i.e. until {@link InputStream#read()}
* returns <code>-1</code>) from the source input stream to the destination
* output stream.
* Copies as many bytes as possible (i.e. until {@link InputStream#read()}
* returns <code>-1</code>) from the source input stream to the destination
* output stream.
* much bytes as possible will be copied (i.e. until
* {@link InputStream#read()} returns <code>-1</code> to signal the end of
* the stream).
* much bytes as possible will be copied (i.e. until
* {@link InputStream#read()} returns <code>-1</code> to signal the end of
* the stream).
* much bytes as possible will be copied (i.e. until
* {@link InputStream#read()} returns <code>-1</code> to signal the end of
* the stream).
* much bytes as possible will be copied (i.e. until
* {@link InputStream#read()} returns <code>-1</code> to signal the end of
* the stream).
/**
* This input stream stores the content of another input stream either in a
* file or in memory, depending on the length of the input stream.
/**
* This input stream stores the content of another input stream either in a
* file or in memory, depending on the length of the input stream.
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public static class TempInputStream extends InputStream {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public static class TempInputStream extends InputStream {
* Creates a new temporary input stream that stores the given input
* stream in memory if it is shorter than {@link #MAX_LENGTH_MEMORY},
* otherwise it is stored in a file.
* Creates a new temporary input stream that stores the given input
* stream in memory if it is shorter than {@link #MAX_LENGTH_MEMORY},
* otherwise it is stored in a file.
* Creates a new temporary input stream that stores the given input
* stream in memory if it is shorter than <code>maxMemoryLength</code>,
* otherwise it is stored in a file.
* Creates a new temporary input stream that stores the given input
* stream in memory if it is shorter than <code>maxMemoryLength</code>,
* otherwise it is stored in a file.