comparing the character '/' from a binary file input stream - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

comparing the character '/' from a binary file input stream

Old Joe (Home)Old Joe (Home) Posts: 3Member
[color=Black][size=4]Hi, Can anyone tell me what I'm doing wrong and offer a working example to compare '/' to a char being input from a binary inputstream.
Here's what I working with right now:[/color][/size][color=Blue]
[code]
for ( int i = 0; i < 3000; i++ )
{
char c = in.readChar();

if ( i > 1580 )
{
characters += c;

if ( i > 1584 )
{

if ( c == 'N' ) //this works
{
one = 'N';
}
// here's where the problem is...
// for some reason I can't find '/' characters
// from the binary file I'm searching, though I have
// opened this file in UltraEdit and have seen
// that the '/' characters exist.
if ( one == 'N' && c == '/' )
{
two = '/';
}
else
{
one = 'X';
}
if ( one == 'N' && two == '/' && c == 'A' )
{
System.out.println( characters );

characters = "";
}
else
{
one = 'X';
two = 'X';
}

}
}
[/code][/color]
[size=4][color=Black]
Thank you for any help rendered.

Regards,
Joe[/size][/color]

Sign In or Register to comment.