MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / read

Method read

java/com/tigervnc/rfb/PixelFormat.java:105–134  ·  view source on GitHub ↗
(InStream is)

Source from the content-addressed store, hash-verified

103 }
104
105 public void read(InStream is) {
106 bpp = is.readU8();
107 depth = is.readU8();
108 bigEndian = is.readU8()!=0;
109 trueColour = is.readU8()!=0;
110 redMax = is.readU16();
111 greenMax = is.readU16();
112 blueMax = is.readU16();
113 redShift = is.readU8();
114 greenShift = is.readU8();
115 blueShift = is.readU8();
116 is.skip(3);
117
118 // We have no real support for colour maps. If the client
119 // wants one, then we force a 8-bit true colour format and
120 // pretend it's a colour map.
121 if (!trueColour) {
122 redMax = 7;
123 greenMax = 7;
124 blueMax = 3;
125 redShift = 0;
126 greenShift = 3;
127 blueShift = 6;
128 }
129
130 if (!isSane())
131 throw new Exception("invalid pixel format: "+print());
132
133 updateState();
134 }
135
136 public void write(OutStream os) {
137 os.writeU8(bpp);

Callers 1

readServerInitMethod · 0.95

Calls 6

isSaneMethod · 0.95
printMethod · 0.95
updateStateMethod · 0.95
readU8Method · 0.45
readU16Method · 0.45
skipMethod · 0.45

Tested by

no test coverage detected