annotate app/src/main/java/org/tn5250j/framework/tn5250/Stream5250.java @ 524:609b142218bc

Added tag stable-1.9.4-7 for changeset 775a81a78a2b
author Carl Byington <carl@five-ten-sg.com>
date Fri, 31 May 2024 21:14:55 -0600
parents 8fa8e73e2f5c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 /**
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2 * Title: tn5250J
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3 * Copyright: Copyright (c) 2001
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 * Company:
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5 * @author Kenneth J. Pouncey
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6 * @version 0.4
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7 *
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 * Description:
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 *
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2, or (at your option)
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
13 * any later version.
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
14 *
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 * GNU General Public License for more details.
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19 *
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
21 * along with this software; see the file COPYING. If not, write to
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23 * Boston, MA 02111-1307 USA
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 *
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
25 */
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
26 package org.tn5250j.framework.tn5250;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
27
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
28 public class Stream5250 {
445
8fa8e73e2f5c update to tn5250j version 0.7.7, svn r1270
Carl Byington <carl@five-ten-sg.com>
parents: 438
diff changeset
29 public static final int OPCODE_OFFSET = 9;
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
30
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
31 public int streamSize;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
32 public int opCode;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
33 public int dataStart;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
34 public int pos;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
35 public byte buffer[];
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
36
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
37 public Stream5250(byte abyte0[]) {
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
38 buffer = abyte0;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
39 // size without end of record 0xFF 0xEF
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
40 streamSize = (abyte0[0] & 0xff) << 8 | abyte0[1] & 0xff;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
41 opCode = abyte0[9];
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
42 dataStart = 6 + abyte0[6];
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
43 pos = dataStart;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
44 }
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
45
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
46 public Stream5250() {
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
47 buffer = null;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
48 streamSize = 0;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
49 opCode = 0;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
50 dataStart = 0;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
51 pos = dataStart;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
52 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
53
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
54 /**
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
55 * This method takes a byte array and initializes the object information
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
56 * to be used.
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
57 *
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
58 * @param abyte0
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
59 */
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
60 public void initialize(byte abyte0[]) {
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
61 buffer = abyte0;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
62 // size without end of record 0xFF 0xEF
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
63 streamSize = (abyte0[0] & 0xff) << 8 | abyte0[1] & 0xff;
445
8fa8e73e2f5c update to tn5250j version 0.7.7, svn r1270
Carl Byington <carl@five-ten-sg.com>
parents: 438
diff changeset
64 opCode = abyte0[OPCODE_OFFSET];
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
65 dataStart = 6 + abyte0[6];
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
66 pos = dataStart;
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
67 }
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
68
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
69 public final int getOpCode() {
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
70 return opCode;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
71 }
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
72
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
73 public final byte getNextByte()
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
74 throws Exception {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
75 if (buffer == null || pos > buffer.length)
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
76 throw new Exception("Buffer length exceeded: " + pos);
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
77 else
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
78 return buffer[pos++];
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
79 }
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
80
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
81 public final void setPrevByte()
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
82 throws Exception {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
83 if (pos == 0) {
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
84 throw new Exception("Index equals zero.");
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
85 }
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
86 else {
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
87 pos--;
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
88 return;
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
89 }
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
90 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
91
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
92 /**
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
93 * Returns where we are in the buffer
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
94 * @return position in the buffer
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
95 */
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
96 public final int getCurrentPos() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
97 return pos;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
98 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
99
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
100 public final byte getByteOffset(int off)
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
101 throws Exception {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
102 if (buffer == null || (pos + off) > buffer.length)
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
103 throw new Exception("Buffer length exceeded: " + pos);
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
104 else
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
105 return buffer[pos + off];
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
106 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
107
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
108 public final boolean size() {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
109 return pos >= streamSize;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
110 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
111
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
112
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
113 /**
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
114 * Determines if any more bytes are available in the buffer to be processed.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
115 * @return yes or no
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
116 */
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
117 public final boolean hasNext() {
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
118 // return pos >= buffer.length;
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
119 return pos < streamSize;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
120 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
121
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
122 /**
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
123 * This routine will retrieve a segment based on the first two bytes being
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
124 * the length of the segment.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
125 *
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
126 * @return a new byte array containing the bytes of the segment.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
127 * @throws Exception
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
128 */
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
129 public final byte[] getSegment() throws Exception {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
130 // The first two bytes contain the length of the segment.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
131 int length = ((buffer[pos] & 0xff) << 8 | (buffer[pos + 1] & 0xff));
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
132 // allocate space for it.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
133 byte[] segment = new byte[length];
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
134 getSegment(segment, length, true);
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
135 return segment;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
136 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
137
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
138
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
139 /**
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
140 * This routine will retrieve a byte array based on the first two bytes being
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
141 * the length of the segment.
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
142 *
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
143 * @param segment - byte array
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
144 * @param length - length of segment to return
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
145 * @param adjustPos - adjust the position of the buffer to the end of the seg
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
146 * ment
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
147 * @throws Exception
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
148 */
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
149 public final void getSegment(byte[] segment, int length, boolean adjustPos)
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
150 throws Exception {
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
151 // If the length is larger than what is available throw an exception
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
152 if ((pos + length) > buffer.length)
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
153 throw new Exception("Buffer length exceeded: start " + pos
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
154 + " length " + length);
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
155
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
156 // use the system array copy to move the bytes from the buffer
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
157 // to the allocated byte array
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
158 System.arraycopy(buffer, pos, segment, 0, length);
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
159
112
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
160 // update the offset to be after the segment so the next byte can be read
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
161 if (adjustPos)
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
162 pos += length;
77ac18bc1b2f cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 3
diff changeset
163 }
3
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
164
e8d2a24e85c6 adding tn5250 files
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
165 }