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

Method write

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

Source from the content-addressed store, hash-verified

119 }
120
121 public int write(ByteBuffer b) throws IOException {
122 if (! connected) {
123 natThrowWriteError(socket);
124 }
125 if (b.remaining() == 0) return 0;
126
127 byte[] array = b.array();
128 if (array == null) throw new NullPointerException();
129
130 int w = natWrite(socket, array, b.arrayOffset() + b.position(), b.remaining(), blocking);
131 if (w > 0) {
132 b.position(b.position() + w);
133 }
134 return w;
135 }
136
137 public long write(ByteBuffer[] srcs) throws IOException {
138 return write(srcs, 0, srcs.length);

Callers 1

runMethod · 0.95

Calls 7

natThrowWriteErrorMethod · 0.95
natWriteMethod · 0.95
hasRemainingMethod · 0.80
remainingMethod · 0.45
arrayMethod · 0.45
arrayOffsetMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected