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

com.tairitsu.ignotus.support.util.BufferWrapper.kt Maven / Gradle / Ivy

//package com.tairitsu.ignotus.support.util
//
//import java.nio.ByteBuffer
//import java.nio.charset.Charset
//import javax.servlet.http.HttpServletRequest
//
//object BufferWrapper {
//    @JvmStatic
//    fun HttpServletRequest.readBodyToString(): String {
//        val bytes = this.inputStream.readAllBytes()
//        val encoding = this.characterEncoding ?: "UTF-8"
//        val charset = try {
//            Charset.forName(encoding)
//        } catch (e: Exception) {
//            Charset.forName("UTF-8")
//        }
//        return charset.decode(ByteBuffer.wrap(bytes)).toString()
//    }
//}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy