Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simulating C++ noskipws manipulator flag in Java.

Status
Not open for further replies.

dbleyl

Programmer
Mar 26, 2001
117
US
Hi,

I have a C++ utility that I've written, which performs an archaic Universal Business Basic function, converting 2 bytes to 3 characters.

The function worked, but was generating erroneous results when called repetitously over a data file.

The solution was to set the flag from 'skipws' to 'noskipws'. This fixed everything.

Now that I have the function converted for use in one of my java applications, I'm getting the same erroneous pattern.

I'm using a FileInputStream, wrapped in a BufferedInputStream. (I've tried using a PushbackInputStream to unread, whitespace characters, but it's not working.)

I'm reading into a byte[], then using the ByteBuffer.wrap(buffer) to access the byte array.


Does anyone know how to simulate noskipws in Java?


 
dbleyl,

There is no corresponding noskipws flag in Java.

you do not tell/show us how you are reading your data using the ByteBuffer object. that makes it difficult to suggest a solution.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top