Tabnine Logo
ReadableByteArray
Code IndexAdd Tabnine to your IDE (free)

How to use
ReadableByteArray
in
com.wizzardo.epoll.readable

Best Java code snippets using com.wizzardo.epoll.readable.ReadableByteArray (Showing top 12 results out of 315)

origin: com.wizzardo/epoll

public ReadableBuilder(byte[] bytes, int offset, int length) {
  this(new ReadableByteArray(bytes, offset, length));
}
origin: com.wizzardo/epoll

@Override
public int read(ByteBuffer byteBuffer) {
  if (size.isComplete())
    return super.read(byteBuffer);
  int r = size.read(byteBuffer);
  if (!size.isComplete())
    return r;
  return r + super.read(byteBuffer);
}
origin: com.wizzardo/epoll

  @Override
  public void unread(int i) {
    if (i <= position)
      super.unread(i);
    else {
      i -= position;
      super.unread(position);
      size.unread(i);
    }
  }
}
origin: com.wizzardo/epoll

public ReadableBuilder append(byte[] bytes, int offset, int length) {
  if (partsCount + 1 >= parts.length)
    increaseSize();
  parts[partsCount] = new ReadableByteArray(bytes, offset, length);
  partsCount++;
  return this;
}
origin: wizzardo/http

public Response setBody(byte[] body) {
  return setBody(new ReadableByteArray(body));
}
origin: com.wizzardo/epoll

public ReadableByteArrayWithSize(byte[] bytes, int offset, int length) {
  super(bytes, offset, length);
  size = new ReadableByteArray(BytesTools.toBytes(length));
}
origin: com.wizzardo/epoll

public boolean write(byte[] bytes, int offset, int length, ByteBufferProvider bufferProvider) {
  return write(new ReadableByteArray(bytes, offset, length), bufferProvider);
}
origin: wizzardo/http

public Renderer renderData(byte[] data) {
  return renderData(new ReadableByteArray(data));
}
origin: wizzardo/http

public Response body(byte[] body) {
  return body(new ReadableByteArray(body));
}
origin: wizzardo/http

public ReadableData renderable() {
  return new ReadableByteArray("foo".getBytes(StandardCharsets.UTF_8));
}
origin: wizzardo/http

protected ReadableData convertFrameToReadableData(Frame frame) {
  return new ReadableByteArray(frame.getFrameBytes(), frame.getFrameOffset(), frame.getFrameLength());
}
origin: wizzardo/http

public void flush(ByteBufferProvider provider) {
  ByteBufferWrapper buffer = provider.getBuffer();
  if (buffer.position() == 0) {
    if (!sending.isEmpty())
      write(provider);
    return;
  }
  try {
    int w = write(buffer, 0, buffer.position());
    ByteBuffer bb = buffer.buffer();
    if (w != bb.position()) {
      bb.flip();
      bb.position(w);
      byte[] bytes = new byte[bb.remaining()];
      bb.get(bytes);
      sending.addFirst(new ReadableByteArray(bytes));
      buffer.clear();
    } else {
      buffer.clear();
      if (!sending.isEmpty())
        write(provider);
    }
  } catch (IOException e) {
    IOTools.close(this);
  }
}
com.wizzardo.epoll.readableReadableByteArray

Most used methods

  • <init>
  • isComplete
  • read
  • unread

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now