Adam Tkac | f53e62a | 2009-03-13 13:20:26 +0000 | [diff] [blame] | 1 | package com.tigervnc.vncviewer; |
enikey | 329d241 | 2008-12-19 04:07:05 +0000 | [diff] [blame] | 2 | |
enikey | 0ef32b2 | 2008-12-19 04:16:34 +0000 | [diff] [blame] | 3 | import java.io.IOException; |
| 4 | |
enikey | aaa273f | 2008-12-19 04:20:42 +0000 | [diff] [blame] | 5 | // |
| 6 | // This class is layer between data of private RfbProto class |
| 7 | // and classes in other packages. |
| 8 | // |
Adam Tkac | f53e62a | 2009-03-13 13:20:26 +0000 | [diff] [blame] | 9 | // For now this class is used by com.tigervnc.decoder.RawDecoder |
enikey | aaa273f | 2008-12-19 04:20:42 +0000 | [diff] [blame] | 10 | // |
enikey | 329d241 | 2008-12-19 04:07:05 +0000 | [diff] [blame] | 11 | public class RfbInputStream { |
enikey | 1e3e9bf | 2008-12-19 04:13:32 +0000 | [diff] [blame] | 12 | RfbInputStream(RfbProto rfbProto) { |
| 13 | rfb = rfbProto; |
| 14 | } |
enikey | 329d241 | 2008-12-19 04:07:05 +0000 | [diff] [blame] | 15 | |
enikey | aaa273f | 2008-12-19 04:20:42 +0000 | [diff] [blame] | 16 | // |
| 17 | // Read data methods |
| 18 | // |
| 19 | |
enikey | 0ef32b2 | 2008-12-19 04:16:34 +0000 | [diff] [blame] | 20 | public void readFully(byte b[]) throws IOException { |
| 21 | readFully(b, 0, b.length); |
| 22 | } |
| 23 | |
| 24 | public void readFully(byte b[], int off, int len) throws IOException { |
| 25 | rfb.readFully(b, off, len); |
| 26 | } |
| 27 | |
| 28 | public int readU32() throws IOException { |
| 29 | return rfb.readU32(); |
| 30 | } |
| 31 | |
| 32 | public int readU8() throws IOException { |
| 33 | return rfb.readU8(); |
| 34 | } |
| 35 | |
| 36 | public int readCompactLen() throws IOException { |
| 37 | return rfb.readCompactLen(); |
| 38 | } |
| 39 | |
enikey | 6154075 | 2008-12-25 08:01:22 +0000 | [diff] [blame] | 40 | public int readU16() throws IOException { |
| 41 | return rfb.readU16(); |
| 42 | } |
| 43 | |
enikey | 1e3e9bf | 2008-12-19 04:13:32 +0000 | [diff] [blame] | 44 | private RfbProto rfb = null; |
enikey | 6154075 | 2008-12-25 08:01:22 +0000 | [diff] [blame] | 45 | } |