in src/com/pty4j/windows/conpty/WinHandleOutputStream.java [28:44]
public void write(byte @NotNull [] b, int off, int len) throws IOException {
Objects.checkFromIndexSize(off, len, b.length);
if (len == 0) {
return;
}
if (myClosed) {
if (myClosedExplicitly) {
throw new IOException("Closed stdout");
}
return;
}
byte[] buffer = Arrays.copyOfRange(b, off, off + len);
IntByReference lpNumberOfBytesWritten = new IntByReference(0);
if (!Kernel32.INSTANCE.WriteFile(myWritePipe, buffer, buffer.length, lpNumberOfBytesWritten, null)) {
throw new LastErrorExceptionEx("WriteFile stdout");
}
}