java.io

Class FileOutputStream

Implemented Interfaces:
Closeable, Flushable

public class FileOutputStream
extends OutputStream

A file output stream is an output stream for writing data to a File or to a FileDescriptor. Whether or not a file is available or may be created depends upon the underlying platform. Some platforms, in particular, allow a file to be opened for writing by only one FileOutputStream (or other file-writing object) at a time. In such situations the constructors in this class will fail if the file involved is already open.

FileOutputStream is meant for writing streams of raw bytes such as image data. For writing streams of characters, consider using FileWriter.

Since:
JDK1.0
See Also:
File, FileDescriptor, FileInputStream

Constructor Summary

FileOutputStream(File file)
Creates a file output stream to write to the file represented by the specified File object.
FileOutputStream(File file, boolean append)
Creates a file output stream to write to the file represented by the specified File object.
FileOutputStream(FileDescriptor fdObj)
Creates an output file stream to write to the specified file descriptor, which represents an existing connection to an actual file in the file system.
FileOutputStream(String name)
Creates an output file stream to write to the file with the specified name.
FileOutputStream(String name, boolean append)
Creates an output file stream to write to the file with the specified name.

Method Summary

void
close()
Closes this file output stream and releases any system resources associated with this stream.
protected void
finalize()
Cleans up the connection to the file, and ensures that the close method of this file output stream is called when there are no more references to this stream.
FileChannel
getChannel()
Returns the unique FileChannel object associated with this file output stream.
FileDescriptor
getFD()
Returns the file descriptor associated with this stream.
void
write(b[] )
Writes b.length bytes from the specified byte array to this file output stream.
void
write(b[] , int off, int len)
Writes len bytes from the specified byte array starting at offset off to this file output stream.
void
write(int b)
Writes the specified byte to this file output stream.

Methods inherited from class java.io.OutputStream

close, flush, write, write, write

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

FileOutputStream

public FileOutputStream(File file)
            throws FileNotFoundException
Creates a file output stream to write to the file represented by the specified File object. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkWrite method is called with the path represented by the file argument as its argument.

If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.

Parameters:
file - the file to be opened for writing.
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
SecurityException - if a security manager exists and its checkWrite method denies write access to the file.
Usages and Demos :

View More Examples of FileOutputStream(File file)
   1:      System.out.println("Validate xhtml error: " + ex.getMessage()) ;
   2:      FileOutputStream out = new FileOutputStream("./target/output.html") ;
   3:      out.write(xhtml.getBytes()) ;
   4:      return false ;
   5:     }

View Full Code Here
   1:         {
   2:             FileOutputStream     fis  = new FileOutputStream(".");
   3:             System.out.println("3 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileOutputStream     fis  = new FileOutputStream(file);
   7:             System.out.println("4 FAIL! Should throw java.io.FileNotFoundException!");
   8:             System.exit(1);
   9:         }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:       pw = new PrintWriter(new OutputStreamWriter(new 
   2:                     FileOutputStream("./file-test.out"))); 
   3: 
   4:       dumpFile(new File("/"));
   5:       dumpFile(new File("~arenn/foo"));

View Full Code Here

FileOutputStream

public FileOutputStream(File file,
                        boolean append)
            throws FileNotFoundException
Creates a file output stream to write to the file represented by the specified File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkWrite method is called with the path represented by the file argument as its argument.

If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.

Parameters:
file - the file to be opened for writing.
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
SecurityException - if a security manager exists and its checkWrite method denies write access to the file.
Since:
1.4
Usages and Demos :

View More Examples of FileOutputStream(File file,boolean append)
   1:     DataOutputStream output =
   2:       new DataOutputStream(new FileOutputStream("Exercise18_2.dat", true));
   3: 
   4:     for (int i = 0; i < 100; i++)
   5:       output.writeInt((int)(Math.random() * 100000));

View Full Code Here
   1:         {
   2:             out = new PrintWriter(new FileOutputStream("call.log", false), true);
   3:         }
   4:         catch(Exception e)
   5:         {

View Full Code Here
   1:             _out = new PrintStream(
   2:                 new FileOutputStream("/home/logs/BugLog",true));
   3:         }
   4:         catch(IOException ioe)
   5:         {

View Full Code Here
   1:             {
   2:                 FileOutputStream fos = new FileOutputStream("SQLUpdate.log", true);
   3:                 fos.write(logBuffer.toByteArray());
   4:                 fos.flush();
   5:                 fos.close();

View Full Code Here

FileOutputStream

public FileOutputStream(FileDescriptor fdObj)
Creates an output file stream to write to the specified file descriptor, which represents an existing connection to an actual file in the file system.

First, if there is a security manager, its checkWrite method is called with the file descriptor fdObj argument as its argument.

Parameters:
fdObj - the file descriptor to be opened for writing
Throws:
SecurityException - if a security manager exists and its checkWrite method denies write access to the file descriptor
Usages and Demos :

View More Examples of FileOutputStream(FileDescriptor fdObj)
   1:      System.out.println("Validate xhtml error: " + ex.getMessage()) ;
   2:      FileOutputStream out = new FileOutputStream("./target/output.html") ;
   3:      out.write(xhtml.getBytes()) ;
   4:      return false ;
   5:     }

View Full Code Here
   1:         {
   2:             FileOutputStream     fis  = new FileOutputStream(".");
   3:             System.out.println("3 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileOutputStream     fis  = new FileOutputStream(file);
   7:             System.out.println("4 FAIL! Should throw java.io.FileNotFoundException!");
   8:             System.exit(1);
   9:         }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:       pw = new PrintWriter(new OutputStreamWriter(new 
   2:                     FileOutputStream("./file-test.out"))); 
   3: 
   4:       dumpFile(new File("/"));
   5:       dumpFile(new File("~arenn/foo"));

View Full Code Here

FileOutputStream

public FileOutputStream(String name)
            throws FileNotFoundException
Creates an output file stream to write to the file with the specified name. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkWrite method is called with name as its argument.

If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.

Parameters:
name - the system-dependent filename
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
SecurityException - if a security manager exists and its checkWrite method denies write access to the file.
Usages and Demos :

View More Examples of FileOutputStream(String name)
   1:      System.out.println("Validate xhtml error: " + ex.getMessage()) ;
   2:      FileOutputStream out = new FileOutputStream("./target/output.html") ;
   3:      out.write(xhtml.getBytes()) ;
   4:      return false ;
   5:     }

View Full Code Here
   1:         {
   2:             FileOutputStream     fis  = new FileOutputStream(".");
   3:             System.out.println("3 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileOutputStream     fis  = new FileOutputStream(file);
   7:             System.out.println("4 FAIL! Should throw java.io.FileNotFoundException!");
   8:             System.exit(1);
   9:         }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:     private void writeHandle(Object obj) throws Exception {
   2:         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("../temp/" + this.getClass() + ".ser"));
   3:         out.writeObject(obj);
   4:         out.close();
   5:     }

View Full Code Here
   1:       pw = new PrintWriter(new OutputStreamWriter(new 
   2:                     FileOutputStream("./file-test.out"))); 
   3: 
   4:       dumpFile(new File("/"));
   5:       dumpFile(new File("~arenn/foo"));

View Full Code Here

FileOutputStream

public FileOutputStream(String name,
                        boolean append)
            throws FileNotFoundException
Creates an output file stream to write to the file with the specified name. If the second argument is true, then bytes will be written to the end of the file rather than the beginning. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkWrite method is called with name as its argument.

If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.

Parameters:
name - the system-dependent file name
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason.
SecurityException - if a security manager exists and its checkWrite method denies write access to the file.
Since:
JDK1.1
Usages and Demos :

View More Examples of FileOutputStream(String name,boolean append)
   1:     DataOutputStream output =
   2:       new DataOutputStream(new FileOutputStream("Exercise18_2.dat", true));
   3: 
   4:     for (int i = 0; i < 100; i++)
   5:       output.writeInt((int)(Math.random() * 100000));

View Full Code Here
   1:         {
   2:             out = new PrintWriter(new FileOutputStream("call.log", false), true);
   3:         }
   4:         catch(Exception e)
   5:         {

View Full Code Here
   1:             _out = new PrintStream(
   2:                 new FileOutputStream("/home/logs/BugLog",true));
   3:         }
   4:         catch(IOException ioe)
   5:         {

View Full Code Here
   1:             {
   2:                 FileOutputStream fos = new FileOutputStream("SQLUpdate.log", true);
   3:                 fos.write(logBuffer.toByteArray());
   4:                 fos.flush();
   5:                 fos.close();

View Full Code Here

Method Details

close

public void close()
            throws IOException
Closes this file output stream and releases any system resources associated with this stream. This file output stream may no longer be used for writing bytes.

If this stream has an associated channel then the channel is closed as well.

Specified by:
close in interface Closeable
Overrides:
close in interface OutputStream
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of close()
   1:     {
   2:         FileOutputStream f = new FileOutputStream("test");
   3:         ObjectOutput s = new ObjectOutputStream(f);
   4:         ...
   5:     s.flush();
   6:     f.close();
   7:         ...
   8:     s.close();
   9:     }

View Full Code Here
   1:     };
   2:     FileOutputStream f = new FileOutputStream("data");
   3:     f.write(data);
   4:         ...
   5:     f.close();
   6:   }
   7: }

View Full Code Here
   1: 
   2:       FileOutputStream fos = 
   3:         ...
   4:         new FileOutputStream(args[0]);
   5: 
   6:         ...
   7: 
   8:       fos.close();
   9:     }

View Full Code Here
   1: FileInputStream in =new FileInputStream("c:\\java\\delttsul.exe");
   2:      FileOutputStream out=new FileOutputStream("c:\\java\\my.exe");
   3:      System.out.println("file size:"+in.available());
   4:         ...
   5:      System.out.println("file copyed and renamed");
   6:      in.close();;
   7:         ...
   8:      out.close();
   9:    }

View Full Code Here
   1:         {
   2:             FileOutputStream f=new FileOutputStream("date.ser");
   3:             
   4:         ...
   5:             s.writeObject(d);
   6:             f.close();
   7:         }
   8:             catch(IOException e)
   9:             {

View Full Code Here

finalize

protected void finalize()
            throws IOException
Cleans up the connection to the file, and ensures that the close method of this file output stream is called when there are no more references to this stream.
Overrides:
finalize in interface Object
Throws:
IOException - if an I/O error occurs.

getChannel

public FileChannel getChannel()
Returns the unique FileChannel object associated with this file output stream.

The initial position of the returned channel will be equal to the number of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. Writing bytes to this stream will increment the channel's position accordingly. Changing the channel's position, either explicitly or by writing, will change this stream's file position.

Returns:
the file channel associated with this file output stream
Since:
1.4
Usages and Demos :

View More Examples of getChannel()
   1:   public static void main(String[] args) throws Exception {
   2:     FileOutputStream fos= new FileOutputStream("file.txt");
   3:         ...
   4:     FileLock fl = fos.getChannel().tryLock();
   5:     if(fl != null) {
   6:       System.out.println("Locked File");
   7:       TimeUnit.MILLISECONDS.sleep(100);

View Full Code Here
   1:   public static void main(String args[])throws Exception{
   2:     FileOutputStream fos=new FileOutputStream("D:\\test.txt");
   3:         ...
   4:     FileLock fl=fos.getChannel().tryLock();
   5:     if(fl!=null){
   6:       System.out.println("Locked File");
   7:       System.out.println(fl.isShared());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     FileOutputStream file = null;
   7:     try {
   8:         ...
   9:       file = new FileOutputStream(aFile, true);
  10:     } catch (FileNotFoundException e) {
  11:         ...
  12:     } 
  13:     FileChannel outChannel = file.getChannel();

View Full Code Here
   1:         fin = new FileInputStream(args[0]);
   2:         FileChannel in = fin.getChannel();
   3: 
   4:         WritableByteChannel out;
   5:         }

View Full Code Here
   1:     private FileLock fileLock;
   2:     private FileOutputStream fileStream;
   3: 
   4:         ...
   5:     public synchronized boolean lock() throws IOException {
   6:         fileStream = new FileOutputStream(lockFile, true);
   7:         try {
   8:         ...
   9:             fileLock = fileStream.getChannel().tryLock();
  10:         } catch (IOException ioe) {

View Full Code Here

getFD

public final FileDescriptor getFD()
            throws IOException
Returns the file descriptor associated with this stream.
Returns:
the FileDescriptor object that represents the connection to the file in the file system being used by this FileOutputStream object.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of getFD()
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:   private static class SafeFileOutputStream extends OutputStream {
   6:     private FileOutputStream fileOutputStream;
   7: 
   8:         ...
   9:       fileOutputStream.flush();
  10:       fileOutputStream.getFD().sync();
  11:       fileOutputStream.close();

View Full Code Here
   1: import java.io.FileInputStream;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:         JarOutputStream jarStream = null;
   6:         FileOutputStream fileStream = null;
   7:         
   8:         ...
   9:             {
  10:                 fileStream = new FileOutputStream(jarFile);
  11:                 jarStream = new JarOutputStream(fileStream);
  12:         ...
  13:                 jarStream.flush();
  14:                 fileStream.getFD().sync();

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:     private void writeSomeBytes(final File file, final int count) throws IOException {
   6:         OutputStream output = new FileOutputStream(file);
   7:         try {
   8:         ...
   9:             foo = File.createTempFile("TestFileLength", ".tmp");
  10:             FileOutputStream fos = new FileOutputStream(foo);
  11:             out = new BufferedOutputStream(fos);

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:       FileOutputStream fos = null;
   7: 
   8:         ...
   9: 
  10:         fos = new FileOutputStream(newFile);
  11:         fos.write(torrentData);
  12:         ...
  13:          fos.flush();
  14:          fos.getFD().sync();

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:   private class BufferedFileOutputStream extends OutputStream {
   6:     private FileOutputStream fileOutputStream;
   7:     private byte[] buffer;
   8:         ...
   9:               fileOutputStream.flush();
  10:               fileOutputStream.getFD().sync();
  11:               fileOutputStream.close();

View Full Code Here

write

public void write(b[] )
            throws IOException
Writes b.length bytes from the specified byte array to this file output stream.
Overrides:
write in interface OutputStream
Parameters:
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of write(b[] )
   1: 
   2: import java.io.FileOutputStream;
   3: 
   4:         ...
   5:                     protected void runImpl(IProgressMonitor monitor) throws Exception {
   6:                         FileOutputStream fos = null;
   7:                         try {
   8:         ...
   9:                             fos = new FileOutputStream (getSecondProject().getLocation().toString() + "/123");
  10:                             fos.write("some contents".getBytes());                            
  11:         ...
  12:                             fos = new FileOutputStream (getFirstProject().getLocation().toString() + "/123");
  13:                             fos.write("".getBytes());                             

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.FileReader;
   4:         ...
   5:             
   6:             FileOutputStream result = new FileOutputStream(new File(dirName + 
   7:                     "/index.html"));
   8:         ...
   9:             result.write("<html><body>".getBytes());
  10:             
  11:         ...
  12:                     
  13:                     result.write(link.getBytes());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:             return;
   6:           FileOutputStream fos = new FileOutputStream(htmlFile);
   7:           String imageTag =
   8:         ...
   9:             + "\" border=\"0\" ismap usemap=\"#map\">\n";
  10:           fos.write(imageTag.getBytes());
  11:           fos.write("<map NAME=\"map\">\n".getBytes());
  12:         ...
  13:                 + "\">\n";
  14:               fos.write(map.getBytes());

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:     private static FileInputStream fis;
   6:     private static FileOutputStream fos;
   7:     private static BufferedReader br;
   8:         ...
   9:         try {
  10:             fos = new FileOutputStream(destDir + "index.htm");
  11: 
  12:         ...
  13:         try {
  14:             fos.write(("<html>" + LINE_SEPARATOR).getBytes());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.util.ArrayList;
   4:         ...
   5:     try {
   6:       FileOutputStream fos = new FileOutputStream(reFile);
   7:       for (int i = 0; i < getContents().size(); i++) {
   8:       }
   9:       fos.close();

View Full Code Here

write

public void write(b[] ,
                  int off,
                  int len)
            throws IOException
Writes len bytes from the specified byte array starting at offset off to this file output stream.
Overrides:
write in interface OutputStream
Parameters:
off - the start offset in the data.
len - the number of bytes to write.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of write(b[] ,int off,int len)
   1: 
   2: import java.io.FileOutputStream;
   3: import java.io.FileInputStream;
   4:         ...
   5: 
   6:         FileOutputStream fos = new FileOutputStream( resourceId );
   7: 
   8:         ...
   9: 
  10:         fos.write( b, 0, b.length );

View Full Code Here
   1: 
   2: import java.io.FileOutputStream;
   3: import java.io.File;
   4:         ...
   5: 
   6:         FileOutputStream fos = new FileOutputStream( getContext().getRealPath(resourceId) );
   7: 
   8:         ...
   9: 
  10:         fos.write( b, 0, b.length );

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.InputStream;
   4:         ...
   5:             f.delete();
   6:             FileOutputStream fo= new FileOutputStream(f);
   7:             byte[] appbt = new byte[2048];
   8:         ...
   9:                 pbrstate.setValue(pbrstate.getValue()+c);
  10:                 fo.write(appbt, 0, c);
  11:             }

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:   private static class SafeFileOutputStream extends OutputStream {
   6:     private FileOutputStream fileOutputStream;
   7: 
   8:         ...
   9:     public void write(byte[] b)  throws IOException {
  10:       fileOutputStream.write(b, 0, b.length);
  11:     }
  12:         ...
  13:     public void write(byte[] b, int offset, int nbytes) throws IOException {
  14:       fileOutputStream.write(b, offset, nbytes);

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:             throws IOException {
   6:         FileOutputStream fs = null;
   7:         InputStream is = null;
   8:         ...
   9: 
  10:             fs = new FileOutputStream(localFile);
  11: 
  12:         ...
  13:                 if (bytesRead > 0) {
  14:                     fs.write(b, 0, bytesRead);

View Full Code Here

write

public void write(int b)
            throws IOException
Writes the specified byte to this file output stream. Implements the write method of OutputStream.
Overrides:
write in interface OutputStream
Parameters:
b - the byte to be written.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of write(int b)
   1: 
   2: import java.io.FileOutputStream;
   3: 
   4:         ...
   5:                     protected void runImpl(IProgressMonitor monitor) throws Exception {
   6:                         FileOutputStream fos = null;
   7:                         try {
   8:         ...
   9:                             fos = new FileOutputStream (getSecondProject().getLocation().toString() + "/123");
  10:                             fos.write("some contents".getBytes());                            
  11:         ...
  12:                             fos = new FileOutputStream (getFirstProject().getLocation().toString() + "/123");
  13:                             fos.write("".getBytes());                             

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.FileReader;
   4:         ...
   5:             
   6:             FileOutputStream result = new FileOutputStream(new File(dirName + 
   7:                     "/index.html"));
   8:         ...
   9:             result.write("<html><body>".getBytes());
  10:             
  11:         ...
  12:                     
  13:                     result.write(link.getBytes());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:             return;
   6:           FileOutputStream fos = new FileOutputStream(htmlFile);
   7:           String imageTag =
   8:         ...
   9:             + "\" border=\"0\" ismap usemap=\"#map\">\n";
  10:           fos.write(imageTag.getBytes());
  11:           fos.write("<map NAME=\"map\">\n".getBytes());
  12:         ...
  13:                 + "\">\n";
  14:               fos.write(map.getBytes());

View Full Code Here
   1: import java.io.FileNotFoundException;
   2: import java.io.FileOutputStream;
   3: import java.io.IOException;
   4:         ...
   5:     private static FileInputStream fis;
   6:     private static FileOutputStream fos;
   7:     private static BufferedReader br;
   8:         ...
   9:         try {
  10:             fos = new FileOutputStream(destDir + "index.htm");
  11: 
  12:         ...
  13:         try {
  14:             fos.write(("<html>" + LINE_SEPARATOR).getBytes());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileOutputStream;
   3: import java.util.ArrayList;
   4:         ...
   5:     try {
   6:       FileOutputStream fos = new FileOutputStream(reFile);
   7:       for (int i = 0; i < getContents().size(); i++) {
   8:       }
   9:       fos.close();

View Full Code Here