/** Convert the buffer to an ISO-8859-1 String * @param buffer The buffer to convert in flush mode. The buffer is unchanged * @return The buffer as a string. */ public static String toString(ByteBuffer buffer) { return toString(buffer, StandardCharsets.ISO_8859_1); }
/** Convert the buffer to an UTF-8 String * @param buffer The buffer to convert in flush mode. The buffer is unchanged * @return The buffer as a string. */ public static String toUTF8String(ByteBuffer buffer) { return toString(buffer, StandardCharsets.UTF_8); }
throw new NumberFormatException(toString(buffer));
return minus ? (-val) : val; throw new NumberFormatException(toString(buffer));
/** * @param encoding the encoding of the content bytes * @return the content as a string, with the specified encoding * @see #getContentAsString() */ public String getContentAsString(Charset encoding) { if (buffer == null) return null; return BufferUtil.toString(buffer, encoding); }
/** * @param charset the charset to encode the output as * @return Returns the out. */ public String getOutputString(Charset charset) { return BufferUtil.toString(_out,charset); }
@Override public String getLastModified() { return BufferUtil.toString(_lastModifiedBytes); }
/** * @return Returns the out. */ public String getOutputString(Charset charset) { return BufferUtil.toString(_out,charset); }
/** Convert the buffer to an UTF-8 String * @param buffer The buffer to convert in flush mode. The buffer is unchanged * @return The buffer as a string. */ public static String toUTF8String(ByteBuffer buffer) { return toString(buffer,StringUtil.__UTF8_CHARSET); }
/** * @return Returns the out. */ public String getOutputString(Charset charset) { return BufferUtil.toString(_out,charset); }
/** Convert the buffer to an UTF-8 String * @param buffer The buffer to convert in flush mode. The buffer is unchanged * @return The buffer as a string. */ public static String toUTF8String(ByteBuffer buffer) { return toString(buffer, StandardCharsets.UTF_8); }
@Override public String getContentType() { return BufferUtil.toString(_contentType); }
/** Convert the buffer to an ISO-8859-1 String * @param buffer The buffer to convert in flush mode. The buffer is unchanged * @return The buffer as a string. */ public static String toString(ByteBuffer buffer) { return toString(buffer,StringUtil.__ISO_8859_1_CHARSET); }
/** * @param encoding the encoding of the content bytes * @return the content as a string, with the specified encoding * @see #getContentAsString() */ public String getContentAsString(String encoding) { if (buffer == null) return null; return BufferUtil.toString(buffer, Charset.forName(encoding)); }
/** * @param charset the charset to encode the output as * @return Returns the out. */ public String takeOutputString(Charset charset) { ByteBuffer buffer=takeOutput(); return BufferUtil.toString(buffer,charset); }
/** * @param charset the charset to encode the output as * @return Returns the out. */ public String takeOutputString(Charset charset) { ByteBuffer buffer=takeOutput(); return BufferUtil.toString(buffer,charset); }
@Override public String toString() { return String.format("CachedContent@%x{r=%s,e=%b,lm=%s,ct=%s}",hashCode(),_resource,_resource.exists(),BufferUtil.toString(_lastModifiedBytes),_contentType); } }
/** * @return Returns the out. */ public String takeOutputString(Charset charset) { ByteBuffer buffer=takeOutput(); return BufferUtil.toString(buffer,charset); }
/** * @return Returns the out. */ public String takeOutputString(Charset charset) { ByteBuffer buffer=takeOutput(); return BufferUtil.toString(buffer,charset); }