nirupamc
asked on
Peek a stream message in java
I need to peek a stream message to do some processing. This needs to be done before reading the whole message
I have the current code
I have the current code
inputStream = new BufferedInputStream(System.in, 1024);
FileOutputStream fos = new FileOutputStream(convTempFileName);
byte[] buf = new byte[256];
int read = 0;
while ((read = inputStream.read(buf)) > 0) {
// Here I need to dos omething when I see some particular element in the message
fos.write(buf, 0, read);
}
fos.close();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is an xml message via a workflow which comes as a standard in to the program that I am working on
2.