comparison src/org/tn5250j/framework/tn5250/DataStreamProducer.java @ 69:294435151b0c tn5250

use 5250 encryption config entry
author Carl Byington <carl@five-ten-sg.com>
date Fri, 13 Jun 2014 19:06:01 -0700
parents 5949eb469a79
children 8181cb01c64d
comparison
equal deleted inserted replaced
68:cc7e3588a0f3 69:294435151b0c
14 import android.util.Log; 14 import android.util.Log;
15 15
16 16
17 public class DataStreamProducer implements Runnable { 17 public class DataStreamProducer implements Runnable {
18 private static final String TAG = "DataStreamProducer"; 18 private static final String TAG = "DataStreamProducer";
19 private tnvt vt;
19 private BufferedInputStream bin; 20 private BufferedInputStream bin;
21 private vt320 buffer;
20 private ByteArrayOutputStream baosin; 22 private ByteArrayOutputStream baosin;
21 private Thread me; 23 private Thread me;
22 private byte[] saveStream; 24 private byte[] saveStream;
23 private final BlockingQueue<Object> dsq; 25 private final BlockingQueue<Object> dsq;
24 private tnvt vt;
25 private byte[] abyte2; 26 private byte[] abyte2;
26 private FileOutputStream fw; 27 private FileOutputStream fw;
27 private BufferedOutputStream dw; 28 private BufferedOutputStream dw;
28 private boolean dumpBytes = false; 29 private boolean dumpBytes = false;
29 private ICodePage codePage; 30 private ICodePage codePage;
30 31
31 32
32 33
33 public DataStreamProducer(tnvt vt, BufferedInputStream in, BlockingQueue<Object> queue, byte[] init) { 34 public DataStreamProducer(tnvt vt, BufferedInputStream bin, vt320 buffer, BlockingQueue<Object> queue, byte[] init) {
34 bin = in; 35 this.bin = bin;
35 this.vt = vt; 36 this.vt = vt;
37 this.buffer = buffer;
36 baosin = new ByteArrayOutputStream(); 38 baosin = new ByteArrayOutputStream();
37 dsq = queue; 39 dsq = queue;
38 abyte2 = init; 40 abyte2 = init;
39 } 41 }
40 42
160 baosin.reset(); 162 baosin.reset();
161 int j = -1; 163 int j = -1;
162 int i = 0; 164 int i = 0;
163 165
164 while(!done) { 166 while(!done) {
165 167 if (bin.available() == 0) buffer.testChanged();
166 i = bin.read(); 168 i = bin.read();
167 169
168 // WVL - LDC : 16/07/2003 : TR.000345 170 // WVL - LDC : 16/07/2003 : TR.000345
169 // The inStream return -1 when end-of-stream is reached. This 171 // The inStream return -1 when end-of-stream is reached. This
170 // happens e.g. when the connection is closed from the AS/400. 172 // happens e.g. when the connection is closed from the AS/400.