Package com.facebook.thrift

Examples of com.facebook.thrift.TException


    }
    try {
      byte[] b = str.getBytes("UTF-8");
      trans_.write(b, 0, b.length);
    } catch (UnsupportedEncodingException uex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8");
    }
    if (escapeNum) {
      trans_.write(QUOTE);
    }
  }
View Full Code Here


    writeJSONInteger(VERSION);
    try {
      byte[] b = message.name.getBytes("UTF-8");
      writeJSONString(b);
    } catch (UnsupportedEncodingException uex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8");
    }
    writeJSONInteger(message.type);
    writeJSONInteger(message.seqid);
  }
View Full Code Here

  public void writeString(String str) throws TException {
    try {
      byte[] b = str.getBytes("UTF-8");
      writeJSONString(b);
    } catch (UnsupportedEncodingException uex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8");
    }
  }
View Full Code Here

                                       "Numeric data unexpectedly quoted");
        }
        return dub;
      }
      catch (UnsupportedEncodingException ex) {
        throw new TException("JVM DOES NOT SUPPORT UTF-8");
      }
    }
    else {
      if (context_.escapeNum()) {
        // This will throw - we should have had a quote if escapeNum == true
View Full Code Here

                                       "Numeric data unexpectedly quoted");
        }
        return flt;
      }
      catch (UnsupportedEncodingException ex) {
        throw new TException("JVM DOES NOT SUPPORT UTF-8");
      }
    }
    else {
      if (context_.escapeNum()) {
        // This will throw - we should have had a quote if escapeNum == true
View Full Code Here

    String name;
    try {
      name = readJSONString(false).toString("UTF-8");
    }
    catch (UnsupportedEncodingException ex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8");
    }
    byte type = (byte) readJSONInteger();
    int seqid = (int) readJSONInteger();
    return new TMessage(name, type, seqid);
  }
View Full Code Here

  public String readString() throws TException {
    try {
      return readJSONString(false).toString("UTF-8");
    }
    catch (UnsupportedEncodingException ex) {
      throw new TException("JVM DOES NOT SUPPORT UTF-8");
    }
  }
View Full Code Here

    // Test oneway
    long startOneway = System.nanoTime();
    testClient.testOneway(3);
    long onewayElapsedMillis = (System.nanoTime() - startOneway) / 1000000;
    if (onewayElapsedMillis > 200) {
      throw new TException("Oneway test failed: took " +
                          Long.toString(onewayElapsedMillis) +
                          "ms");
    }

    // Just do some basic testing that the event handler is called.
View Full Code Here

   * one element at a time, with peekMap method.
   */
  public abstract TMap readMapBegin() throws TException;

  public boolean peekMap() throws TException {
    throw new TException("Peeking into a map not supported, likely because it's sized");
  }
View Full Code Here

   * one element at a time, with peekList method.
   */
  public abstract TList readListBegin() throws TException;

  public boolean peekList() throws TException {
    throw new TException("Peeking into a list not supported, likely because it's sized");
  }
View Full Code Here

TOP

Related Classes of com.facebook.thrift.TException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.