Audiovox P965 Datasheet Page 102

  • Download
  • Add to my manuals
  • Print
  • Page
    / 280
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 101
API in Java
99
private DataInputStream in = null;
LinkedBlockingQueue queue = null;
/**
* Creates a new instance of CommandRead
* @param in - Data input stream of socket
* @param queue - data output inteface
*/
public ReadCommand(DataInputStream in, LinkedBlockingQueue queue) {
this.in = in;
this.queue = queue;
}
@Override
public void run() {
byte b = 0;
String s = "";
char ch;
int a = 0;
while (true) {
int sk = 0;
try {
a = in.read();
} catch (IOException ex) {
return;
}
if (a != 0 && a > 0) {
if (a < 0x80) {
sk = a;
} else {
if (a < 0xC0) {
a = a << 8;
try {
a += in.read();
} catch (IOException ex) {
return;
}
sk = a ^ 0x8000;
} else {
if (a < 0xE0) {
try {
for (int i = 0; i < 2; i++) {
a = a << 8;
a += in.read();
}
} catch (IOException ex) {
Logger.getLogger(ReadCommand.class.getName()).log(Level.SEVERE, null, ex);
Page view 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 279 280

Comments to this Manuals

No comments