COMMUNITY

How to check bytebuff is string or not?

how to check bytebuff is string or not ?

The standard library doesn’t have a “bytebuff” type,
please specify which library/class you are using, maybe even a small code sample, otherwise it’s impossible to help you.

                var b0 = _buffer.readByte();
                var b1 = _buffer.readByte();

                _isFinal = ((b0 >> 7) & 1) != 0;
                _opcode = cast(((b0 >> 0) & 0xF), OpCode);
                _frameIsBinary = if (_opcode == OpCode.Text) false; else if (_opcode == OpCode.Binary) true; else _frameIsBinary;

current I use a haxe websocket lib, and the server side check data from client is Text ,but my js side

is set to _ws.binaryType = BinaryType.ARRAYBUFFER;

-lib hxWebSockets

it’s my code error,sorry,fixed.