diff options
author | Kenny Root <kenny@the-b.org> | 2009-06-01 00:59:33 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2009-06-01 00:59:33 +0000 |
commit | c7c7a278a663584f5e480c61d2de6192b32b19cf (patch) | |
tree | 91d21813546ffa8c21907fc961d7091e116e56c7 /src/com/trilead/ssh2/channel | |
parent | d7e42975724f5a6098d6f4b4f24cf2278e6d97d3 (diff) | |
download | connectbot-c7c7a278a663584f5e480c61d2de6192b32b19cf.tar.gz connectbot-c7c7a278a663584f5e480c61d2de6192b32b19cf.tar.bz2 connectbot-c7c7a278a663584f5e480c61d2de6192b32b19cf.zip |
Reduce allocations in read and write path, pass 1 (there is still more allocation badness in insertLine to take care of)
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@252 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src/com/trilead/ssh2/channel')
-rw-r--r-- | src/com/trilead/ssh2/channel/ChannelOutputStream.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/trilead/ssh2/channel/ChannelOutputStream.java b/src/com/trilead/ssh2/channel/ChannelOutputStream.java index 3fd7214..30e8fd8 100644 --- a/src/com/trilead/ssh2/channel/ChannelOutputStream.java +++ b/src/com/trilead/ssh2/channel/ChannelOutputStream.java @@ -13,20 +13,21 @@ public final class ChannelOutputStream extends OutputStream {
Channel c;
+ private byte[] writeBuffer;
+
boolean isClosed = false;
ChannelOutputStream(Channel c)
{
this.c = c;
+ writeBuffer = new byte[1];
}
public void write(int b) throws IOException
{
- byte[] buff = new byte[1];
-
- buff[0] = (byte) b;
+ writeBuffer[0] = (byte) b;
- write(buff, 0, 1);
+ write(writeBuffer, 0, 1);
}
public void close() throws IOException
|