MCPcopy Create free account
hub / github.com/ReadyTalk/avian / write

Method write

classpath/java/nio/channels/DatagramChannel.java:107–121  ·  view source on GitHub ↗
(ByteBuffer b)

Source from the content-addressed store, hash-verified

105 }
106
107 public int write(ByteBuffer b) throws IOException {
108 if (b.remaining() == 0) return 0;
109
110 byte[] array = b.array();
111 if (array == null) throw new NullPointerException();
112
113 int c = write
114 (socket, array, b.arrayOffset() + b.position(), b.remaining(), blocking);
115
116 if (c > 0) {
117 b.position(b.position() + c);
118 }
119
120 return c;
121 }
122
123 public int read(ByteBuffer b) throws IOException {
124 int p = b.position();

Callers 1

testMethod · 0.95

Calls 4

remainingMethod · 0.45
arrayMethod · 0.45
arrayOffsetMethod · 0.45
positionMethod · 0.45

Tested by 1

testMethod · 0.76