Package com.caucho.vfs

Examples of com.caucho.vfs.RandomAccessStream


  {
    RandomAccessWrapper wrapper = openRowFile(true);
    boolean isPriority = true;

    try {
      RandomAccessStream file = wrapper.getFile();

      _fileSize = file.getLength();
    } finally {
      closeRowFile(wrapper, isPriority);
    }
  }
View Full Code Here


  {
    boolean isPriority = false;
    RandomAccessWrapper wrapper = openRowFile(isPriority);

    try {
      RandomAccessStream is = wrapper.getFile();

      long blockAddress = blockId & BlockStore.BLOCK_MASK;

      if (blockAddress < 0 || _fileSize < blockAddress + length) {
        throw new IllegalStateException(L.l("block at 0x{0} is invalid for file {1} (length 0x{2})",
                                            Long.toHexString(blockAddress),
                                            _path,
                                            Long.toHexString(_fileSize)));
      }

      // System.out.println("READ: " + Long.toHexString(blockAddress));
      int readLen = is.read(blockAddress, buffer, offset, length);

      if (readLen < 0) {
        throw new IllegalStateException("Error reading " + is + " for block " + Long.toHexString(blockAddress) + " result=" + readLen);
      }
View Full Code Here

   * Implements the EnvCleanup interface.
   */
  public void cleanup()
  {
    try {
      RandomAccessStream ras = _stream;
      _stream = null;

      if (ras != null) {
        ras.close();

        if (_temporary)
          _path.remove();
      }
    } catch (IOException e) {
View Full Code Here

   * Implements the EnvCleanup interface.
   */
  public void cleanup()
  {
    try {
      RandomAccessStream ras = _stream;
      _stream = null;

      if (ras != null) {
        ras.close();

        if (_temporary)
          _path.remove();
      }
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.caucho.vfs.RandomAccessStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.