Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , , ,

Sponsored Links



Content of BufferedInputStream

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-01-2010
Member
 
Join Date: Dec 2009
Posts: 213
Content of BufferedInputStream

Hello,
I have small query, I want to know how to display the contents of a BufferedInputStream.
Quote:
BufferedInputStream bis = new BufferedInputStream(new FileOutputStream(filename));
then write in the buffer using the method
Quote:
bis.write();
I would like to view the content of the file filename. Thank you in advance.

Last edited by Aaliya Seth : 28-01-2010 at 02:20 PM.
Reply With Quote
  #2  
Old 28-01-2010
MindSpace's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,832
Re: Content of BufferedInputStream

Hi
If you want to read the contents of the file, just follow this
Quote:
BufferedIntputStream bis = new BufferedIntputStream(new FileIntputStream(filename),500);
And then
Quote:
bis.read();
without forgetting to close the buffer.
Quote:
bis.close()
This will ensure that the buffer is properly closed.
Reply With Quote
  #3  
Old 28-01-2010
Member
 
Join Date: Dec 2009
Posts: 213
Re: Content of BufferedInputStream

Hello,
I tried bis.read function () but it can not read my file, I think the problem is that writing is not made or every time I write a character, it is overwritten by the next. Does anyone have an idea about the working principle of the function bis.write () or a possible cause to my problem? Thank you. If there is any alternative method to read the content then please do post back.
Reply With Quote
  #4  
Old 28-01-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
Re: Content of BufferedInputStream

Hello,
I think that you have not flushed your data, that is have you used the following method in your code.
Quote:
bsi.flush();
You have to do this after the method, that is after you have written the data to the destination.
Quote:
bsi.write();
Reply With Quote
  #5  
Old 28-01-2010
Member
 
Join Date: Dec 2009
Posts: 213
Re: Content of BufferedInputStream

Hello,
I have not understood your question but here is the code I use
Code:
 int i, j =0;	
 while ((i = bis.read()) != -1) {
		while(fn == false)	
		{
			if (tab[j][j] ! = I)
			{
				j + +;
			}
			
			else
			{
				fn = true;
bis.write(tab[j][j+1]);
bis.flush();
	
			}
			
		}
		}
		
	BufferedInputStream bis1 = new BufferedInputStream(new FileInputStream(StrComp)); 
	int k = 0;
    while ((k = bis1.read()) != -1) {
    	bis1.read();
    }
Reply With Quote
  #6  
Old 28-01-2010
Member
 
Join Date: May 2008
Posts: 1,990
Re: Content of BufferedInputStream

Hello,
Well I assume you have two files myfile and myfile2.
Quote:
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(test));
BufferedInputStream biscomp = new BufferedInputStream(new FileOutputStream(test2));
to be clean if you can test your way str is valid. After you read in a but what do with it.
Quote:
if (tab[x][x] ! = I)
{
x + +;
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Content of BufferedInputStream"
Thread Thread Starter Forum Replies Last Post
Content blocker blocks content on certain sites with Opera GiveNTake Technology & Internet 5 21-06-2011 08:30 AM
How to use CSS content boxes Botan Software Development 1 08-01-2011 12:18 PM
How to generate content with CSS Eshita The Techie Software Development 5 08-01-2011 11:54 AM
Content of the same cell ISAIAH Software Development 5 03-02-2010 02:50 AM
WirelessHD(TM) Announces Publication of Wireless DTCP Content Protection Specification for High Definition Content Jerome Web News & Trends 1 27-08-2008 02:21 PM


All times are GMT +5.5. The time now is 11:23 AM.