Solved

What defines a markSupported()-stream?

Posted on 1997-06-10
2
188 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
ID: 1221474
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
ID: 1221475
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

774 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