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

Class OutputStreamChannel

classpath/java/nio/channels/Channels.java:114–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 private static class OutputStreamChannel implements WritableByteChannel {
115 private OutputStream stream;
116
117 public OutputStreamChannel(OutputStream stream) {
118 this.stream = stream;
119 }
120
121 public void close() throws IOException {
122 if (stream != null) {
123 stream.close();
124 stream = null;
125 }
126 }
127
128 public boolean isOpen() {
129 return stream != null;
130 }
131
132 public int write(ByteBuffer b) throws IOException {
133 stream.write(b.array(), b.arrayOffset() + b.position(), b.remaining());
134
135 int c = b.remaining();
136
137 b.position(b.limit());
138
139 return c;
140 }
141 }
142}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected