forked from sirthias/scala-ssh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ByteBufferSourceClass to expose byte buffer uploading capabilities
ScpTransferable new method to utilise aforementioned class Version increment
- Loading branch information
Maksymilian Pawlak
committed
Sep 14, 2015
1 parent
bfc2c61
commit 8705ced
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/scala/com/decodified/scalassh/ByteBufferSourceFile.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.decodified.scalassh | ||
|
||
import java.io.{ ByteArrayInputStream, InputStream } | ||
|
||
import net.schmizz.sshj.xfer.InMemorySourceFile | ||
|
||
/** | ||
* Created by M4ks on 14/09/2015. | ||
*/ | ||
class ByteBufferSourceFile(bytes: Array[Byte], name: String) extends InMemorySourceFile { | ||
|
||
override def getLength: Long = bytes.length | ||
|
||
override def getName: String = name | ||
|
||
override def getInputStream: InputStream = new ByteArrayInputStream(bytes) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters