Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def readShortString(buffer: ByteBuffer): String = {
- val size: Int = buffer.getShort()
- if(size < 0)
- return null
- val bytes = new Array[Byte](size)
- buffer.get(bytes)
- new String(bytes, ProtocolEncoding)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement