All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.moaxcp.x11.protocol.X11Input Maven / Gradle / Ivy

package com.github.moaxcp.x11.protocol;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public interface X11Input {
  boolean readBool() throws IOException;

  List readBool(int length) throws IOException;

  byte readByte() throws IOException;

  byte peekByte() throws IOException;

  byte readInt8() throws IOException;

  short readInt16() throws IOException;

  int readInt32() throws IOException;

  List readInt32(int length) throws IOException;

  long readInt64() throws IOException;

  byte readCard8() throws IOException;

  List readCard8(int length) throws IOException;

  short readCard16() throws IOException;

  List readCard16(int length) throws IOException;

  int readCard32() throws IOException;

  List readCard32(int length) throws IOException;

  long readCard64() throws IOException;

  List readCard64(int length) throws IOException;

  float readFloat() throws IOException;

  List readFloat(int length) throws IOException;

  double readDouble() throws IOException;

  List readDouble(int length) throws IOException;

  List readChar(int length) throws IOException;

  String readString8(int length) throws IOException;

  List readByte(int length) throws IOException;

  List readVoid(int length) throws IOException;

  int readFd() throws IOException;

  List readFd(int length) throws IOException;

  byte[] readPad(int length) throws IOException;

  default void readPadAlign(int forLength) throws IOException {
    readPad(XObject.getSizeForPadAlign(forLength));
  }

  default void readPadAlign(int align, int forLength) throws IOException {
    readPad(XObject.getSizeForPadAlign(align, forLength));
  }

  void peekWith(X11InputConsumer consumer) throws IOException;

  int available() throws IOException;

  default  List readObject(XReadFunction reader, int length) throws IOException {
    List result = new ArrayList<>();
    for(int i = 0; i < length; i++) {
      T object = reader.read(this);
      result.add(object);
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy