Package jp.gr.java_conf.dangan.io
Class GrowthByteBuffer
java.lang.Object
jp.gr.java_conf.dangan.io.GrowthByteBuffer
?????I???L??????o?b?t?@?B
RandomAccessFile ?? ???????????????g?p?????B ???????A?????????????f?[?^????????????????????????B ?X???b?h?Z?[?t????????B jdk1.4 ???~?? ByteBuffer????????????????B
RandomAccessFile ?? ???????????????g?p?????B ???????A?????????????f?[?^????????????????????????B ?X???b?h?Z?[?t????????B jdk1.4 ???~?? ByteBuffer????????????????B
-- revision history -- $Log: GrowthByteBuffer.java,v $ Revision 1.1 2002/12/05 00:00:00 dangan [maintenance] ?\?[?X???? Revision 1.0 2002/07/24 00:00:00 dangan add to version control [bug fix] grow() ???o?b?t?@???????????v?Z??????????????????C???B [change] ???????????E???B???????? read( new byte[0] ) ?? read( byte[] buf, int off, 0 ) ???????l?? InputStream ??????? 0 ???????????????? [maintenance] ?\?[?X????
- Version:
- $Revision: 1.1 $
- Author:
- $Author: dangan $
-
Constructor Summary
ConstructorsConstructorDescription?T?C?Y?????????L??????o?b?t?@???\?z?????B
?o?b?t?@?T?C?Y?????f?t?H???g?l???g?p???????BGrowthByteBuffer
(int BufferSize) ?T?C?Y?????????L??????o?b?t?@???\?z?????B -
Method Summary
Modifier and TypeMethodDescriptionint
length()
???????????}?????E???????Bint
position()
???????u???????Bint
read()
???????u???? 1byte???f?[?^???????}???Bint
read
(byte[] buffer) ???????u???? buffer???????????????f?[?^???????????Bint
read
(byte[] buffer, int index, int length) ???????u???? buffer ??index?? length???f?[?^???????????Bvoid
seek
(int position) ???????u???????????B java.io.RandomAccessFile??????? seek ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????Bvoid
setLength
(int length) ?????}?????E???u???????????Bvoid
setPosition
(int position) ???????u???????????B java.io.RandomAccessFile??????? setPosition ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????Bvoid
write
(byte[] buffer) ???????u?? buffer ?????e???????}???Bvoid
write
(byte[] buffer, int index, int length) ???????u?? buffer ?? index????length?o?C?g?????e???????}???Bvoid
write
(int data) ???????u?? 1?o?C?g???f?[?^???????}???B
-
Constructor Details
-
GrowthByteBuffer
public GrowthByteBuffer()?T?C?Y?????????L??????o?b?t?@???\?z?????B
?o?b?t?@?T?C?Y?????f?t?H???g?l???g?p???????B -
GrowthByteBuffer
public GrowthByteBuffer(int BufferSize) ?T?C?Y?????????L??????o?b?t?@???\?z?????B- Parameters:
BufferSize
- ?o?b?t?@???T?C?Y
-
-
Method Details
-
write
public void write(int data) ???????u?? 1?o?C?g???f?[?^???????}???B- Parameters:
data
- 1?o?C?g???f?[?^
-
write
public void write(byte[] buffer) ???????u?? buffer ?????e???????}???B- Parameters:
buffer
- ?????}???f?[?^???i?[???????o?b?t?@
-
write
public void write(byte[] buffer, int index, int length) ???????u?? buffer ?? index????length?o?C?g?????e???????}???B- Parameters:
buffer
- ?????}???f?[?^???i?[???????o?b?t?@index
- buffer?????????}???f?[?^???J?n???ulength
- ?????}???f?[?^??
-
read
public int read()???????u???? 1byte???f?[?^???????}???B- Returns:
- ?????}??????1byte???f?[?^?B
?????}?????E???L?????????????????????? -1
-
read
public int read(byte[] buffer) ???????u???? buffer???????????????f?[?^???????????B- Parameters:
buffer
- ?f?[?^???????????o?b?t?@- Returns:
- ???????????}???????f?[?^??
?????}?????E???L?????????????????????? -1
-
read
public int read(byte[] buffer, int index, int length) ???????u???? buffer ??index?? length???f?[?^???????????B- Parameters:
buffer
- ?f?[?^???????????o?b?t?@index
- buffer???f?[?^?????}?????ulength
- ?????????f?[?^????- Returns:
- ???????????}???????f?[?^??
?????}?????E???L?????????????????????? -1
-
length
public int length()???????????}?????E???????B- Returns:
- ???????????}?????E
-
setLength
public void setLength(int length) ?????}?????E???u???????????B -
position
public int position()???????u???????B- Returns:
- ???????u
-
setPosition
public void setPosition(int position) ???????u???????????B java.io.RandomAccessFile??????? setPosition ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????B- Parameters:
position
- ?V??????????u
-
seek
public void seek(int position) ???????u???????????B java.io.RandomAccessFile??????? seek ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????B- Parameters:
position
- ?V??????????u
-