本文整理汇总了Java中org.alfresco.jlan.smb.SeekType.EndOfFile方法的典型用法代码示例。如果您正苦于以下问题:Java SeekType.EndOfFile方法的具体用法?Java SeekType.EndOfFile怎么用?Java SeekType.EndOfFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.jlan.smb.SeekType
的用法示例。
在下文中一共展示了SeekType.EndOfFile方法的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();
}
示例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();
}
示例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();
}