当前位置: 首页>>代码示例>>Java>>正文


Java SeekType类代码示例

本文整理汇总了Java中org.alfresco.jlan.smb.SeekType的典型用法代码示例。如果您正苦于以下问题:Java SeekType类的具体用法?Java SeekType怎么用?Java SeekType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SeekType类属于org.alfresco.jlan.smb包,在下文中一共展示了SeekType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: seekFile

import org.alfresco.jlan.smb.SeekType; //导入依赖的package包/类
@Override
public long seekFile(final long pos, final int typ) throws IOException {
    if (_inputData == null) {
        openFile(false);
    }

    switch (typ) {
        case SeekType.StartOfFile:
            _inputData.seek(pos);
            break;

        case SeekType.CurrentPos:
            _inputData.seek(_inputData.getPosition() + pos);
            break;

        case SeekType.EndOfFile:
            _inputData.seek(_inputData.getSize() + pos);
            break;
    }

    return currentPosition();
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:23,代码来源:RemoteNetworkFile.java

示例2: seekFile

import org.alfresco.jlan.smb.SeekType; //导入依赖的package包/类
/**
 * Seek to the specified file position.
 * 
 * @param pos long
 * @param typ int
 * @return long
 * @exception IOException
 */
public long seekFile(long pos, int typ) throws IOException
{
    // Seek to the required file position

    switch (typ)
    {
    // From start of file

    case SeekType.StartOfFile:
        if (currentPosition() != pos)
            m_filePos = pos;
        break;

    // From current position

    case SeekType.CurrentPos:
        m_filePos += pos;
        break;

    // From end of file

    case SeekType.EndOfFile:
        m_filePos += pos;
        if ( m_filePos < 0)
            m_filePos = 0L;
        break;
    }

    // Return the new file position

    return currentPosition();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:LinkMemoryNetworkFile.java

示例3: seekFile

import org.alfresco.jlan.smb.SeekType; //导入依赖的package包/类
/**
 * Seek to a new position in the file
 * 
 * @param pos long
 * @param typ int
 * @return long
 */
@Override
public long seekFile(long pos, int typ)
	throws IOException
{
    //  Open the file, if not already open

    openContent( false, false);

    //  Check if the current file position is the required file position

    long curPos = channel.position();
    
    switch (typ) {

      //  From start of file

      case SeekType.StartOfFile :
        if (curPos != pos)
          channel.position( pos);
        break;

        //  From current position

      case SeekType.CurrentPos :
        channel.position( curPos + pos);
        break;

        //  From end of file

      case SeekType.EndOfFile :
        {
          long newPos = channel.size() + pos;
          channel.position(newPos);
        }
        break;
    }

    // Update the access date/time
    
    if ( getFileState() != null)
    	getFileState().updateAccessDateTime();

    // DEBUG
    
    if (logger.isDebugEnabled())
        logger.debug("Seek file=" + this + ", pos=" + pos + ", type=" + typ);

    //  Return the new file position

    return channel.position();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:59,代码来源:ContentNetworkFile.java


注:本文中的org.alfresco.jlan.smb.SeekType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。