in src/main/java/com/pastdev/jsch/nio/file/UnixSshSeekableByteChannel.java [119:136]
public UnixSshSeekableByteChannel truncate( long size ) throws IOException {
if ( !writeable ) {
throw new NonWritableChannelException();
}
if ( size < 0 ) {
throw new IllegalArgumentException( "size must be positive" );
}
if ( size >= this.size ) {
return this;
}
provider.truncateFile( path, position );
if ( position > size ) {
position = size;
}
this.size = size;
return this;
}