MCPcopy Create free account
hub / github.com/benfry/processing4 / read

Method read

java/libraries/net/src/processing/net/Client.java:377–388  ·  view source on GitHub ↗

Returns a number between 0 and 255 for the next byte that's waiting in the buffer. Returns -1 if there is no byte, although this should be avoided by first checking available() to see if any data is available. @webref client @usage application @webBrief Returns a value from the buffer

()

Source from the content-addressed store, hash-verified

375 * @webBrief Returns a value from the buffer
376 */
377 public int read() {
378 synchronized (bufferLock) {
379 if (bufferIndex == bufferLast) return -1;
380
381 int outgoing = buffer[bufferIndex++] & 0xff;
382 if (bufferIndex == bufferLast) { // rewind
383 bufferIndex = 0;
384 bufferLast = 0;
385 }
386 return outgoing;
387 }
388 }
389
390
391 /**

Callers 2

readCharMethod · 0.95
runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected