Lines Matching refs:sink
133 /** Moves {@code byteCount} bytes from this segment to {@code sink}. */
134 public void writeTo(Segment sink, int byteCount) {
135 if (!sink.owner) throw new IllegalArgumentException();
136 if (sink.limit + byteCount > SIZE) {
137 // We can't fit byteCount bytes at the sink's current position. Shift sink first.
138 if (sink.shared) throw new IllegalArgumentException();
139 if (sink.limit + byteCount - sink.pos > SIZE) throw new IllegalArgumentException();
140 System.arraycopy(sink.data, sink.pos, sink.data, 0, sink.limit - sink.pos);
141 sink.limit -= sink.pos;
142 sink.pos = 0;
145 System.arraycopy(data, pos, sink.data, sink.limit, byteCount);
146 sink.limit += byteCount;