blob: cac3ec7795b586090c3b2f6cae8d1b264489e2e5 [file] [log] [blame]
Adam Tkacf53e62a2009-03-13 13:20:26 +00001package com.tigervnc.vncviewer;
enikey329d2412008-12-19 04:07:05 +00002
enikey0ef32b22008-12-19 04:16:34 +00003import java.io.IOException;
4
enikeyaaa273f2008-12-19 04:20:42 +00005//
6// This class is layer between data of private RfbProto class
7// and classes in other packages.
8//
Adam Tkacf53e62a2009-03-13 13:20:26 +00009// For now this class is used by com.tigervnc.decoder.RawDecoder
enikeyaaa273f2008-12-19 04:20:42 +000010//
enikey329d2412008-12-19 04:07:05 +000011public class RfbInputStream {
enikey1e3e9bf2008-12-19 04:13:32 +000012 RfbInputStream(RfbProto rfbProto) {
13 rfb = rfbProto;
14 }
enikey329d2412008-12-19 04:07:05 +000015
enikeyaaa273f2008-12-19 04:20:42 +000016 //
17 // Read data methods
18 //
19
enikey0ef32b22008-12-19 04:16:34 +000020 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
enikey61540752008-12-25 08:01:22 +000040 public int readU16() throws IOException {
41 return rfb.readU16();
42 }
43
enikey1e3e9bf2008-12-19 04:13:32 +000044 private RfbProto rfb = null;
enikey61540752008-12-25 08:01:22 +000045}