|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.izforge.izpack.io.FileSpanningOutputStream
public class FileSpanningOutputStream
An outputstream which transparently spans over multiple volumes. The size of the volumes and an additonal space for the first volume can be specified.
| Field Summary | |
|---|---|
protected java.io.File |
currentfile
|
protected int |
currentvolumeindex
|
static long |
DEFAULT_ADDITIONAL_FIRST_VOLUME_FREE_SPACE_SIZE
|
protected static java.lang.String |
DEFAULT_VOLUME_NAME
|
static long |
DEFAULT_VOLUME_SIZE
|
protected static long |
FILE_NOT_AVAILABLE
|
private java.io.FileOutputStream |
fileoutputstream
|
protected long |
filepointer
|
protected long |
firstvolumefreespacesize
|
static long |
KB
|
static int |
MAGIC_NUMER_LENGTH
|
private byte[] |
magicnumber
|
protected long |
maxvolumesize
|
static long |
MB
|
protected long |
totalbytesofpreviousvolumes
|
protected java.lang.String |
volumename
|
static java.lang.String |
VOLUMES_INFO
|
private java.util.zip.GZIPOutputStream |
zippedoutputstream
|
| Constructor Summary | |
|---|---|
|
FileSpanningOutputStream()
|
|
FileSpanningOutputStream(java.io.File volume)
|
|
FileSpanningOutputStream(java.io.File volume,
long maxvolumesize)
Creates a new spanning output stream with specified volume names and a maximum volume size |
protected |
FileSpanningOutputStream(java.io.File volume,
long maxvolumesize,
int currentvolume)
Creates a new spanning output stream with specified volume names and a maximum volume size |
|
FileSpanningOutputStream(java.lang.String volumename)
|
|
FileSpanningOutputStream(java.lang.String volumename,
long maxvolumesize)
Creates a new spanning output stream with specified volume names and a maximum volume size |
| Method Summary | |
|---|---|
void |
close()
|
protected void |
createStreamToNextVolume()
Closes the stream to the current volume and reopens to the next volume |
private void |
createVolumeOutputStream(java.io.File volume,
long maxvolumesize,
int currentvolume)
Actually creates the outputstream for writing a volume with index currentvolume and a maximum of maxvolumesize |
void |
flush()
|
private void |
generateMagicNumber()
|
long |
getCompressedFilepointer()
Returns the current position in this file |
protected long |
getCurrentVolumeSize()
Returns the size of the current volume |
long |
getFilepointer()
|
long |
getFirstvolumefreespacesize()
|
int |
getVolumeCount()
Returns the amount of currently created volumes |
void |
setFirstvolumefreespacesize(long firstvolumefreespacesize)
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long KB
public static final long MB
public static final long DEFAULT_VOLUME_SIZE
public static final long DEFAULT_ADDITIONAL_FIRST_VOLUME_FREE_SPACE_SIZE
protected static final java.lang.String DEFAULT_VOLUME_NAME
protected static final long FILE_NOT_AVAILABLE
protected long maxvolumesize
protected long firstvolumefreespacesize
public static final java.lang.String VOLUMES_INFO
public static final int MAGIC_NUMER_LENGTH
protected java.io.File currentfile
protected java.lang.String volumename
protected int currentvolumeindex
private java.io.FileOutputStream fileoutputstream
private java.util.zip.GZIPOutputStream zippedoutputstream
private byte[] magicnumber
protected long filepointer
protected long totalbytesofpreviousvolumes
| Constructor Detail |
|---|
public FileSpanningOutputStream(java.lang.String volumename,
long maxvolumesize)
throws java.io.IOException
volumename - - the name of the volumesmaxvolumesize - - the maximum volume size
java.io.IOException
public FileSpanningOutputStream(java.io.File volume,
long maxvolumesize)
throws java.io.IOException
volume - - the first volumemaxvolumesize - - the maximum volume size
java.io.IOException
protected FileSpanningOutputStream(java.io.File volume,
long maxvolumesize,
int currentvolume)
throws java.io.IOException
volume - - the first volumemaxvolumesize - - the maximum volume sizecurrentvolume - - the current volume
java.io.IOException
public FileSpanningOutputStream(java.io.File volume)
throws java.io.IOException
volume -
java.io.IOException
public FileSpanningOutputStream(java.lang.String volumename)
throws java.io.IOException
volumename -
java.io.IOException
public FileSpanningOutputStream()
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
private void generateMagicNumber()
private void createVolumeOutputStream(java.io.File volume,
long maxvolumesize,
int currentvolume)
throws java.io.IOException
volume - - the volume to write tomaxvolumesize - - the maximum volume sizecurrentvolume - - the currentvolume index
java.io.IOExceptionprotected long getCurrentVolumeSize()
protected void createStreamToNextVolume()
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOExceptionOutputStream.close()
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionOutputStream.write(byte[], int, int)
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionOutputStream.write(byte[])
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionOutputStream.write(int)
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionOutputStream.flush()public int getVolumeCount()
public long getFirstvolumefreespacesize()
public void setFirstvolumefreespacesize(long firstvolumefreespacesize)
firstvolumefreespacesize -
public long getCompressedFilepointer()
throws java.io.IOException
java.io.IOExceptionpublic long getFilepointer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||