Package org.tn5250j.framework.tn5250
Class Stream5250
- java.lang.Object
-
- org.tn5250j.framework.tn5250.Stream5250
-
public class Stream5250 extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description byte[]bufferintdataStartintopCodestatic intOPCODE_OFFSETintposintstreamSize
-
Constructor Summary
Constructors Constructor Description Stream5250()Stream5250(byte[] abyte0)
-
Method Summary
Modifier and Type Method Description bytegetByteOffset(int off)intgetCurrentPos()Returns where we are in the bufferbytegetNextByte()intgetOpCode()byte[]getSegment()This routine will retrieve a segment based on the first two bytes being the length of the segment.voidgetSegment(byte[] segment, int length, boolean adjustPos)This routine will retrieve a byte array based on the first two bytes being the length of the segment.booleanhasNext()Determines if any more bytes are available in the buffer to be processed.voidinitialize(byte[] abyte0)This method takes a byte array and initializes the object information to be used.voidsetPrevByte()booleansize()
-
-
-
Field Detail
-
OPCODE_OFFSET
public static final int OPCODE_OFFSET
- See Also:
- Constant Field Values
-
streamSize
public int streamSize
-
opCode
public int opCode
-
dataStart
public int dataStart
-
pos
public int pos
-
buffer
public byte[] buffer
-
-
Method Detail
-
initialize
public void initialize(byte[] abyte0)
This method takes a byte array and initializes the object information to be used.- Parameters:
abyte0- bytes
-
getOpCode
public final int getOpCode()
-
getNextByte
public final byte getNextByte() throws java.lang.Exception- Throws:
java.lang.Exception
-
setPrevByte
public final void setPrevByte() throws java.lang.Exception- Throws:
java.lang.Exception
-
getCurrentPos
public final int getCurrentPos()
Returns where we are in the buffer- Returns:
- position in the buffer
-
getByteOffset
public final byte getByteOffset(int off) throws java.lang.Exception- Throws:
java.lang.Exception
-
size
public final boolean size()
-
hasNext
public final boolean hasNext()
Determines if any more bytes are available in the buffer to be processed.- Returns:
- yes or no
-
getSegment
public final byte[] getSegment() throws java.lang.ExceptionThis routine will retrieve a segment based on the first two bytes being the length of the segment.- Returns:
- a new byte array containing the bytes of the segment.
- Throws:
java.lang.Exception- exception
-
getSegment
public final void getSegment(byte[] segment, int length, boolean adjustPos) throws java.lang.ExceptionThis routine will retrieve a byte array based on the first two bytes being the length of the segment.- Parameters:
segment- - byte arraylength- - length of segment to returnadjustPos- - adjust the position of the buffer to the end of the seg ment- Throws:
java.lang.Exception- exception
-
-