Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Bytes that just... disappear...

Reply
Thread Tools

Bytes that just... disappear...

 
 
AndrewTK
Guest
Posts: n/a
 
      05-09-2006
Hi,

I am trying to write an input stream that also caters for the concept
of "line"

My class uses a BufferedInputStream for the actual reading, and I add,
by extending, a readLine() method

I run into a problem when trying to read bytes: (I have code at
http://www.dcs.st-and.ac.uk/~atk1/ja...eamReader.java)

1/ I read bytes into a buffer byte array 'minibuff'
2/ I iterate over each byte and check for a CR, LF, or CRLF pair

Before I enter the iteration loop, it is possible to print out the
input received. Thereafter, the bytes don't appear to EXIST... The
printBinaryByte() method I provide works before the for loop is
entered, but disappears afterwards.

I don't really know how to explain what I mean by disappears... nothing
prints when your try to print the byte, and binary comparison yeilds
nothing at all either... nothing prints to nowhere.

I am very confused.

 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      05-09-2006


AndrewTK wrote On 05/09/06 16:15,:
> Hi,
>
> I am trying to write an input stream that also caters for the concept
> of "line"
>
> My class uses a BufferedInputStream for the actual reading, and I add,
> by extending, a readLine() method
>
> I run into a problem when trying to read bytes: (I have code at
> http://www.dcs.st-and.ac.uk/~atk1/ja...eamReader.java)
>
> 1/ I read bytes into a buffer byte array 'minibuff'
> 2/ I iterate over each byte and check for a CR, LF, or CRLF pair
>
> Before I enter the iteration loop, it is possible to print out the
> input received. Thereafter, the bytes don't appear to EXIST... The
> printBinaryByte() method I provide works before the for loop is
> entered, but disappears afterwards.


The loop never executes.

int line_end = -1;
// irrelevant stuff ...
for(int i=0;i<r && line_end != -1;i++) {
^^^^^^^^^^^^^^
equals false


--


 
Reply With Quote
 
 
 
 
AndrewTK
Guest
Posts: n/a
 
      05-10-2006
I have had the disappearing byte problem before, I swear... In a
different context though, so that's why I posted.

Albeit I look very stupid now. But thanks for the tip off...!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Ratio of Bytes Delayed to Bytes Sent netproj Cisco 0 12-21-2005 08:08 PM
Private Bytes vs. # Bytes in all Heaps in Perfmon Jason Collins ASP .Net 3 02-18-2004 03:59 PM
Re: receiving Bytes and sending Bytes Ieuan Adams Computer Support 0 07-24-2003 07:46 PM
Re: receiving Bytes and sending Bytes The Old Sourdough Computer Support 0 07-23-2003 01:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57