Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Forcing Updates to a File to the Disk

                         

In this program we are going to update a file forcefully. Firstly we have to make an object of OutputStream and pass a file name in which you want to update in the constructor of a FileOutputStream class. After that pass some data to the stream. The methods we are using in this class has already been discussed in other topics.

 

Code of the program is given below:

 

 

import java.io.*;

public class ForcingUpdates
{
  public static void main(String[] args
  {
    try 
    {
      // Open or create the output file
          OutputStream os = new FileOutputStream("tapan.txt");
    
      // Write some data to the stream
      byte[] data = new byte[]
      {
        (byte)124,(byte)66 };
            os.write(data);
        os.close();
    
    catch (IOException e
    {
      System.out.println("The exception has been thrown : " + e);
    }
    System.out.println("Congrats you have entered the text forcefully");
  }
}

Output is given below:

C:\ForcingUpdates>java ForcingUpdates
Congrats you have entered the text forcefully

Download this example

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

Its an excellent site where we get every detail about programming language, for beginners its very easy and step by step procedures which is easy to follow.

Posted by prajwal on Thursday, 08.7.08 @ 14:51pm | #71565

Latest Searches:
Detached criteria
Java Count words,reve
java write file line b
display image in java
program to invoke ejb
PDF Tutorials
how to write in pdf us
input and output speed
Hibernate Min() Functi
Reading File into Byte
write int to file
spring with quartz
checkbox button enable
jar
square root loop
ั?à¹???ะà¸?ะà¸?à
tibco
decimals
ejp
fireTableCellUpdated
Copy One Database Tabl
breakаÐ?????аÐ????а
create txt file in spe
Photoshop Cut out imag
hibernate many to many
jsp bank examples
log4j:WARN No appender
file read and write i
value change listener
Add listener to compon
xml to Excel using ja
Photoshop Text Effects
source code for displa
comparing the elements
java quiz
how to get applicate s
Creating Website with
navigate to other page
day number of year
seam tutorial
Removing
tuxedo
prefix=
"day number of year"
java servlets
source code for displa
load file
array element in php
how can create panel g
maven
GMT
Setting Header
Nested WHILE LOOPS
Photoshop Digital Art
Error handling in stru
program
websphere administrati
dojo dialog
program in java to dis
substring
convert date to number
struts2 file upload
compression of a file
How to show expression
Flash Special Effects
Photoshop Photo Effect
Database MS Access Dat
Tutorial:FlashBasicPas
insert data to text fi
passing value from ser
adding scrollbar in Jp
jsp Insert data in mys
Photoshop Textures and
Selection Sort In Java
Photoshop Digital Art
Exercise - Pad Left
Set hashCode
Tomcat deploy JSP
How to create Jasperpr
transientinjava
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.