本文整理汇总了Java中javax.imageio.stream.ImageOutputStream.getStreamPosition方法的典型用法代码示例。如果您正苦于以下问题:Java ImageOutputStream.getStreamPosition方法的具体用法?Java ImageOutputStream.getStreamPosition怎么用?Java ImageOutputStream.getStreamPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.imageio.stream.ImageOutputStream
的用法示例。
在下文中一共展示了ImageOutputStream.getStreamPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verify
import javax.imageio.stream.ImageOutputStream; //导入方法依赖的package包/类
private static void verify(ImageOutputStream ios,
long expstreampos, int expbitoffset)
throws IOException, RuntimeException
{
long actstreampos = ios.getStreamPosition();
int actbitoffset = ios.getBitOffset();
if ((actstreampos != expstreampos) ||
(actbitoffset != expbitoffset))
{
System.err.println("Expected stream position: " + expstreampos +
" Actual: " + actstreampos);
System.err.println("Expected bit offset: " + expbitoffset +
" Actual: " + actbitoffset);
throw new RuntimeException("Test failed.");
}
}
示例2: ChunkStream
import javax.imageio.stream.ImageOutputStream; //导入方法依赖的package包/类
public ChunkStream(int type, ImageOutputStream stream) throws IOException {
this.stream = stream;
this.startPos = stream.getStreamPosition();
stream.writeInt(-1); // length, will backpatch
writeInt(type);
}
示例3: ChunkStream
import javax.imageio.stream.ImageOutputStream; //导入方法依赖的package包/类
ChunkStream(int type, ImageOutputStream stream) throws IOException {
this.stream = stream;
this.startPos = stream.getStreamPosition();
stream.writeInt(-1); // length, will backpatch
writeInt(type);
}
示例4: AVIOutputStream
import javax.imageio.stream.ImageOutputStream; //导入方法依赖的package包/类
/**
* Creates a new AVI output stream with the specified video format and
* framerate.
*
* @param out
* the underlying output stream
* @param format
* Selects an encoder for the video format.
* @exception IllegalArgumentException
* if videoFormat is null or if framerate is <= 0
*/
public AVIOutputStream(ImageOutputStream out, VideoFormat format)
throws IOException {
if (format == null) {
throw new IllegalArgumentException("format must not be null");
}
this.out = out;
this.streamOffset = out.getStreamPosition();
this.videoFormat = format;
this.videoFrames = new LinkedList<Sample>();
}