Class GrowthByteBuffer


  • public class GrowthByteBuffer
    extends java.lang.Object
    ?????I???L??????o?b?t?@?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

      Constructors 
      Constructor Description
      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​(int BufferSize)
      ?T?C?Y?????????L??????o?b?t?@???\?z?????B
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int length()
      ???????????}?????E???????B
      int position()
      ???????u???????B
      int read()
      ???????u???? 1byte???f?[?^???????}???B
      int read​(byte[] buffer)
      ???????u???? buffer???????????????f?[?^???????????B
      int read​(byte[] buffer, int index, int length)
      ???????u???? buffer ??index?? length???f?[?^???????????B
      void seek​(int position)
      ???????u???????????B java.io.RandomAccessFile??????? seek ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????B
      void setLength​(int length)
      ?????}?????E???u???????????B
      void setPosition​(int position)
      ???????u???????????B java.io.RandomAccessFile??????? setPosition ???????}?????E???L?????l?? ?????????????????o?b?t?@???????????????B ?????? write ?????????????}??????????? ?????o?b?t?@???????????B
      void write​(byte[] buffer)
      ???????u?? buffer ?????e???????}???B
      void write​(byte[] buffer, int index, int length)
      ???????u?? buffer ?? index????length?o?C?g?????e???????}???B
      void write​(int data)
      ???????u?? 1?o?C?g???f?[?^???????}???B
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • 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???u
        length - ?????}???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?[?^?????}?????u
        length - ?????????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