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

Method readString

java/com/tigervnc/rdr/InStream.java:76–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 // readString() reads a string - a U32 length followed by the data.
75
76 public final String readString() {
77 int len = readU32();
78 if (len > maxStringLength)
79 throw new Exception("InStream max string length exceeded");
80
81 ByteBuffer str = ByteBuffer.allocate(len);
82 readBytes(str, len);
83 String utf8string = new String();
84 try {
85 utf8string = new String(str.array(),"UTF8");
86 } catch(java.io.UnsupportedEncodingException e) {
87 e.printStackTrace();
88 }
89 return utf8string;
90 }
91
92 // maxStringLength protects against allocating a huge buffer. Set it
93 // higher if you need longer strings.

Callers 7

processMsgMethod · 0.45
readServerInitMethod · 0.45
readSetDesktopNameMethod · 0.45
readClientRedirectMethod · 0.45

Calls 2

readU32Method · 0.95
readBytesMethod · 0.95

Tested by

no test coverage detected