public class BitOutputStream
extends java.io.OutputStream
-- revision history -- $Log: BitOutputStream.java,v $ Revision 1.1 2002/12/05 00:00:00 dangan [maintenance] ソース整備 Revision 1.0 2002/09/11 00:00:00 dangan add to version control [change] close() 後の write系メソッドと flush() で 例外を投げるように修正 [maintenance] タブ廃止 ライセンス文の修正
Constructor and Description |
---|
BitOutputStream(java.io.OutputStream out)
出力ストリーム out へ データをビット単位で
書きこめるようなストリームを構築する。
キャッシュサイズにはデフォルト値が使用される。 |
BitOutputStream(java.io.OutputStream out,
int CacheSize)
出力ストリーム out へ データをビット単位で
書きこめるようなストリームを構築する。
|
Modifier and Type | Method and Description |
---|---|
void |
close()
この出力ストリームと、接続された出力ストリームを閉じ、
使用していたリソースを開放する。
|
void |
flush()
このビット出力ストリームにバッファリングされている
8ビット単位のデータを全て出力先に出力する。
8ビットに満たないデータは出力されないことに注意。
|
void |
write(byte[] buffer)
接続された出力ストリームにbufferの内容を連続した
8ビットのデータとして出力する。
|
void |
write(byte[] buffer,
int index,
int length)
接続された出力ストリームにbufferのindexから
lengthバイトの内容を連続した 8ビットのデータ
として出力する。
|
void |
write(int data)
接続された出力ストリームに 8ビットのデータを出力する。
|
void |
writeBit(int data)
接続された出力ストリームに1ビットのデータを出力する。
|
void |
writeBits(int count,
int data)
接続された出力ストリームにビットデータを出力する。
|
void |
writeBoolean(boolean bool)
真偽値を接続された出力ストリームに1ビットの
データとして出力する。
true は 1、false は 0として出力する。 java.io.DataOutput の writeBoolean() とは 互換性が無いので注意すること。 |
public BitOutputStream(java.io.OutputStream out)
out
- 出力ストリームpublic BitOutputStream(java.io.OutputStream out, int CacheSize)
out
- 出力ストリームCacheSize
- キャッシュサイズjava.lang.IllegalArgumentException
- CacheSize が 4未満の場合、または
CacheSize が 4の倍数で無い場合。public void write(int data) throws java.io.IOException
write
in class java.io.OutputStream
data
- 8ビットのデータ。java.io.IOException
- 入出力エラーが発生した場合public void write(byte[] buffer) throws java.io.IOException
write
in class java.io.OutputStream
buffer
- 出力すべきデータを格納したバイト配列java.io.IOException
- 入出力エラーが発生した場合public void write(byte[] buffer, int index, int length) throws java.io.IOException
write
in class java.io.OutputStream
buffer
- 出力すべきデータを格納したバイト配列index
- buffer内のデータ開始位置length
- 出力するデータ量(バイト数)java.io.IOException
- 入出力エラーが発生した場合public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- 入出力エラーが発生した場合public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
- 入出力エラーが発生した場合public void writeBit(int data) throws java.io.IOException
data
- 1ビットのデータ。java.io.IOException
- 入出力エラーが発生した場合public void writeBoolean(boolean bool) throws java.io.IOException
bool
- 真偽値java.io.IOException
- 入出力エラーが発生した場合public void writeBits(int count, int data) throws java.io.IOException
count
- data の有効ビット数data
- ビットデータjava.io.IOException
- 入出力エラーが発生した場合
When you found typographical errors or omissions, Please mail to cqw10305@nifty.com
The company name and product name which are used in this document, it is the trademark or registered trademark of each company generally.
Copyright © 2001-2002 Michel Ishizuka. All Rights Reserved.