Solved

What defines a markSupported()-stream?

Posted on 1997-06-10
2
185 Views
Last Modified: 2006-11-17
When is it possible to use the mark()-method on a stream, i.e. how do I have to define (new?) a stream to be able to set a mark in it? I have a stream that I want to scroll back in (it is a movie with frames). It would be great if you could go back to the previous frame(picture) in the stream by having set the mark at the beginning and, reset() to the mark and skip to the correct oofset (i.e. the previous picture).
0
Comment
Question by:jonte
2 Comments
 

Accepted Solution

by:
vanegas earned 100 total points
Comment Utility
It all depends which particular subclass of lang.io.InputStream or of lang.io.Reader is in question.  BufferedReader, for example, does support marking and so its markSupported() always returns true.

If the class of the stream which feeds you frames does not support marking, you might consider wrapping it with a BufferedInputStream object.

0
 

Author Comment

by:jonte
Comment Utility
OK, thanks for your answer. I found that the RandomAccessFile-class with its seek(offset)-method will work out for me.

Jonas
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now