Package org.apache.maven.wagon
Class LazyFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.maven.wagon.LazyFileOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class LazyFileOutputStream extends java.io.OutputStreamVariant of FileOutputStream which creates the file only when first portion of data is written.
-
-
Constructor Summary
Constructors Constructor Description LazyFileOutputStream(java.io.File file)LazyFileOutputStream(java.lang.String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanequals(java.lang.Object obj)voidflush()java.nio.channels.FileChannelgetChannel()java.io.FileDescriptorgetFD()inthashCode()private voidinitialize()java.lang.StringtoString()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
getChannel
public java.nio.channels.FileChannel getChannel()
-
getFD
public java.io.FileDescriptor getFD() throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
write
public void write(byte[] b) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(byte[], int, int)
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Parameters:
b-- Throws:
java.io.IOException
-
initialize
private void initialize() throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
-