Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Peek a stream message in java

Posted on 2008-10-05
3
Medium Priority
?
810 Views
Last Modified: 2012-05-05
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


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();

Open in new window

0
Comment
Question by:nirupamc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
libin_v earned 1500 total points
ID: 22645226
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 22656578
have a question, before I suggest a solution, What is type of message? Java serialized object? or some other type
2.
0
 

Author Comment

by:nirupamc
ID: 22749893

This is an xml message via a workflow which comes as a standard in to the program that I am working on
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question