类 MemoryByteArray

java.lang.Object
com.google.typography.font.sfntly.data.ByteArray<MemoryByteArray>
com.google.typography.font.sfntly.data.MemoryByteArray

final class MemoryByteArray extends ByteArray<MemoryByteArray>
A fixed size memory implementation of the ByteArray interface.
作者:
Stuart Gill
  • 字段详细资料

    • b

      private byte[] b
  • 构造器详细资料

    • MemoryByteArray

      public MemoryByteArray(int length)
      Construct a new MemoryByteArray with a new array of the size given. It is assumed that none of the array is filled and readable.
      参数:
      length - the length to make the storage array
    • MemoryByteArray

      public MemoryByteArray(byte[] b)
      Construct a new MemoryByteArray to wrap the actual underlying byte array. This MemoryByteArray takes ownership of the array after construction and it should not be used outside of this object. It is assumed that the entire array is filled and readable.
      参数:
      b - the byte array that provides the actual storage
    • MemoryByteArray

      public MemoryByteArray(byte[] b, int filledLength)
      Construct a new MemoryByteArray to wrap the actual underlying byte array. This MemoryByteArray takes ownership of the array after construction and it should not be used outside of this object.
      参数:
      b - the byte array that provides the actual storage
      filledLength - the index of the last byte in the array has data
      抛出:
      IndexOutOfBoundsException - if the given bounds don't fit within the byte array given
  • 方法详细资料

    • internalPut

      protected void internalPut(int index, byte b)
      从类复制的说明: ByteArray
      Stores the byte at the index given.
      指定者:
      internalPut 在类中 ByteArray<MemoryByteArray>
      参数:
      index - the location to store at
      b - the byte to store
    • internalPut

      protected int internalPut(int index, byte[] b, int offset, int length)
      从类复制的说明: ByteArray
      Stores the array of bytes at the given index.
      指定者:
      internalPut 在类中 ByteArray<MemoryByteArray>
      参数:
      index - the location to store at
      b - the bytes to store
      offset - the offset to start from in the byte array
      length - the length of the byte array to store from the offset
      返回:
      the number of bytes actually stored
    • internalGet

      protected int internalGet(int index)
      从类复制的说明: ByteArray
      Gets the byte at the index given.
      指定者:
      internalGet 在类中 ByteArray<MemoryByteArray>
      参数:
      index - the location to get from
      返回:
      the byte stored at the index
    • internalGet

      protected int internalGet(int index, byte[] b, int offset, int length)
      从类复制的说明: ByteArray
      Gets the bytes at the index given of the given length.
      指定者:
      internalGet 在类中 ByteArray<MemoryByteArray>
      参数:
      index - the location to start getting from
      b - the array to put the bytes into
      offset - the offset in the array to put the bytes into
      length - the length of bytes to read
      返回:
      the number of bytes actually ready
    • close

      public void close()
      从类复制的说明: ByteArray
      Close this instance of the ByteArray.
      指定者:
      close 在类中 ByteArray<MemoryByteArray>
    • copyTo

      public int copyTo(OutputStream os, int offset, int length) throws IOException
      从类复制的说明: ByteArray
      Copies this ByteArray to an OutputStream.
      覆盖:
      copyTo 在类中 ByteArray<MemoryByteArray>
      参数:
      os - the destination
      offset -
      length -
      返回:
      the number of bytes copied
      抛出:
      IOException