summaryrefslogtreecommitdiffstats
path: root/java/src/com/tigervnc/vncviewer/RfbInputStream.java
blob: cac3ec7795b586090c3b2f6cae8d1b264489e2e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.tigervnc.vncviewer;

import java.io.IOException;

//
// This class is layer between data of private RfbProto class
// and classes in other packages.
//
// For now this class is used by com.tigervnc.decoder.RawDecoder
//
public class RfbInputStream {
  RfbInputStream(RfbProto rfbProto) {
    rfb = rfbProto;
  }

  //
  // Read data methods
  //

  public void readFully(byte b[]) throws IOException {
    readFully(b, 0, b.length);
  }

  public void readFully(byte b[], int off, int len) throws IOException {
    rfb.readFully(b, off, len);
  }

  public int readU32() throws IOException  {
    return rfb.readU32();
  }

  public int readU8() throws IOException  {
    return rfb.readU8();
  }

  public int readCompactLen() throws IOException {
    return rfb.readCompactLen();
  }

  public int readU16() throws IOException {
    return rfb.readU16();
  }

  private RfbProto rfb = null;
}