File tree Expand file tree Collapse file tree
src/net/tootallnate/websocket Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package net .tootallnate .websocket ;
2+
3+ import java .io .UnsupportedEncodingException ;
4+
5+ public class Charsetfunctions {
6+
7+ /*
8+ * @return UTF-8 encoding in bytes
9+ */
10+ public static byte [] utf8Bytes ( String s ) {
11+ try {
12+ return s .getBytes ( "UTF8" );
13+ } catch ( UnsupportedEncodingException e ) {
14+ throw new RuntimeException ( e );
15+ }
16+ }
17+
18+ /*
19+ * @return ASCII encoding in bytes
20+ */
21+ public static byte [] asciiBytes ( String s ) {
22+ try {
23+ return s .getBytes ( "ASCII" );
24+ } catch ( UnsupportedEncodingException e ) {
25+ throw new RuntimeException ( e );
26+ }
27+ }
28+
29+ public static String stingAscii ( byte [] bytes ) {
30+ try {
31+ return new String ( bytes , "ASCII" );
32+ } catch ( UnsupportedEncodingException e ) {
33+ throw new RuntimeException ( e );
34+ }
35+ }
36+
37+ public static String stingUtf8 ( byte [] bytes ) {
38+ try {
39+ return new String ( bytes , "UTF8" );
40+ } catch ( UnsupportedEncodingException e ) {
41+ throw new RuntimeException ( e );
42+ }
43+ }
44+ }
Original file line number Diff line number Diff line change 1+ package net .tootallnate .websocket .exeptions ;
2+
3+ public class LimitExedeedException extends InvalidDataException {
4+
5+ public LimitExedeedException () {
6+ }
7+
8+ public LimitExedeedException ( String s ) {
9+ super ( s );
10+ }
11+
12+ public LimitExedeedException ( Throwable t ) {
13+ super ( t );
14+ }
15+
16+ public LimitExedeedException ( String s , Throwable t ) {
17+ super ( s , t );
18+ }
19+
20+ }
You can’t perform that action at this time.
0 commit comments