Skip to content

Commit 90b6131

Browse files
committed
added missing files
1 parent 1bafce4 commit 90b6131

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}

0 commit comments

Comments
 (0)