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

com.devops4j.embedded.servlet.EmbeddedServletInputStream Maven / Gradle / Ivy

There is a newer version: 0.0.4-alpha
Show newest version
package com.devops4j.embedded.servlet;

import com.devops4j.embedded.buffer.ByteBuf;
import lombok.Data;

import javax.servlet.ReadListener;
import java.io.IOException;

@Data
class EmbeddedServletInputStream extends javax.servlet.ServletInputStream {
    ByteBuf byteBuf;

    public EmbeddedServletInputStream(ByteBuf byteBuf) {
        this.byteBuf = byteBuf;
    }

    @Override
    public boolean isFinished() {
        return true;
    }

    @Override
    public boolean isReady() {
        return true;
    }

    @Override
    public void setReadListener(ReadListener readListener) {

    }

    @Override
    public int read() throws IOException {
        return byteBuf.getInt();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy