Example usage for java.io InputStream getClass

List of usage examples for java.io InputStream getClass

Introduction

In this page you can find the example usage for java.io InputStream getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.integration.x.ip.websocket.WebSocketSerializer.java

@Override
public DataFrame deserialize(InputStream inputStream) throws IOException {
    if (this.streamChecked == null) {
        this.nio = inputStream.getClass().getName().endsWith("TcpNioConnection$ChannelInputStream");
        this.streamAccessor = new DirectFieldAccessor(inputStream);
        this.streamChecked = Boolean.TRUE;
    }/*  w w  w .j a  v  a2 s. co  m*/
    DataFrame frame = null;
    BasicState state = this.getState(inputStream);
    if (state != null) {
        frame = state.getPendingFrame();
    }
    while (frame == null || (frame.getPayload() == null && frame.getBinary() == null)) {
        frame = doDeserialize(inputStream, frame);
        if (frame.getPayload() == null && frame.getBinary() == null) {
            state.setPendingFrame(frame);
        }
    }
    return frame;
}