com.github.moaxcp.x11client.protocol.randr.RefreshRates Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of x11-client Show documentation
Show all versions of x11-client Show documentation
An x11 client implemented in java
package com.github.moaxcp.x11client.protocol.randr;
import com.github.moaxcp.x11client.protocol.X11Input;
import com.github.moaxcp.x11client.protocol.X11Output;
import com.github.moaxcp.x11client.protocol.XStruct;
import java.io.IOException;
import java.lang.Override;
import java.lang.Short;
import java.util.List;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;
@Value
@Builder
public class RefreshRates implements XStruct {
@NonNull
private List rates;
public static RefreshRates readRefreshRates(X11Input in) throws IOException {
short nRates = in.readCard16();
List rates = in.readCard16(Short.toUnsignedInt(nRates));
RefreshRates.RefreshRatesBuilder javaBuilder = RefreshRates.builder();
javaBuilder.rates(rates);
return javaBuilder.build();
}
@Override
public void write(X11Output out) throws IOException {
short nRates = (short) rates.size();
out.writeCard16(nRates);
out.writeCard16(rates);
}
@Override
public int getSize() {
return 2 + 2 * rates.size();
}
public static class RefreshRatesBuilder {
public int getSize() {
return 2 + 2 * rates.size();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy