Example usage for java.lang Integer MAX_VALUE

List of usage examples for java.lang Integer MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Integer MAX_VALUE.

Prototype

int MAX_VALUE

To view the source code for java.lang Integer MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value an int can have, 231-1.

Usage

From source file:com.smartitengineering.util.simple.io.BufferedInputStream.java

public BufferedInputStream(InputStream wrappedStream) {
    this(wrappedStream, Integer.MAX_VALUE / 2);
}

From source file:net.mohatu.bloocoin.miner.RegCustom.java

private void genData() {
    Random r = new Random();
    key = DigestUtils.sha1Hex((randomString() + r.nextInt(Integer.MAX_VALUE)).toString()).toString();
    System.out.println("Addr: " + addr + "\nKey: " + key);
}

From source file:com.zimbra.common.util.BufferStreamRequestEntity.java

public BufferStreamRequestEntity(InputStream is, long sizeHint) {
    this(is, sizeHint, Integer.MAX_VALUE);
}

From source file:edu.cornell.med.icb.goby.reads.ReadProtobuffCollectionHandler.java

@Override
public GeneratedMessage parse(final InputStream compressedBytes) throws IOException {
    final byte[] bytes = IOUtils.toByteArray(compressedBytes);
    final CodedInputStream codedInput = CodedInputStream.newInstance(bytes);
    codedInput.setSizeLimit(Integer.MAX_VALUE);

    return Reads.ReadCollection.parseFrom(codedInput);
}

From source file:craterdog.collections.Queue.java

/**
 * This constructor creates a new queue of unlimited capacity.
 */
public Queue() {
    logger.entry();
    this.capacity = Integer.MAX_VALUE;
    logger.exit();
}

From source file:nl.igorski.lib.utils.network.ResponseParser.java

private static String _getResponseBody(final HttpEntity entity) throws IOException, ParseException {
    if (entity == null)
        throw new IllegalArgumentException("HTTP entity may not be null");

    InputStream instream = entity.getContent();

    if (instream == null)
        return "";

    if (entity.getContentLength() > Integer.MAX_VALUE)
        throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");

    String charset = getContentCharSet(entity);

    if (charset == null)
        charset = HTTP.DEFAULT_CONTENT_CHARSET;

    Reader reader = new InputStreamReader(instream, charset);
    StringBuilder buffer = new StringBuilder();

    try {//www  .  j a  v a2s  . c  om
        char[] tmp = new char[1024];
        int l;
        while ((l = reader.read(tmp)) != -1) {
            buffer.append(tmp, 0, l);
        }
    } finally {
        reader.close();
    }
    return buffer.toString();
}

From source file:com.alibaba.dubbo.demo.consumer.DemoAction.java

public void testSayHello() throws InterruptedException {
    for (int i = 0; i < Integer.MAX_VALUE; i++) {
        try {/*from   www .  j a  v  a  2  s .  co m*/
            String hello = demoService.sayHello("world" + i);
            System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] " + hello);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Thread.sleep(2000);
    }
}

From source file:org.eel.kitchen.jsonschema.syntax.PositiveIntegerSyntaxChecker.java

@Override
final void checkValue(final Message.Builder msg, final List<Message> messages, final JsonNode schema) {
    final JsonNode node = schema.get(keyword);
    msg.addInfo("found", node);

    if (!node.canConvertToInt()) {
        msg.setMessage("integer value is too large").addInfo("max", Integer.MAX_VALUE);
        messages.add(msg.build());/*from w  w w .  j av a 2s  . com*/
        return;
    }

    if (node.intValue() >= 0)
        return;

    messages.add(msg.setMessage("value cannot be negative").build());
}

From source file:controllers.VisitorControllerDocTesterTest.java

@Test
@SneakyThrows/*from  ww  w  . j a v a2 s  . co  m*/
public void testGetVisitorByMissingId() {
    String missingId = String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
    Response response = makeRequest(
            Request.GET().url(testServerUrl().path(VISITOR_URL).addQueryParameter("id", missingId)));

    assertThat(response.payloadJsonAs(Visitor.class), equalTo(new Visitor()));
}

From source file:com.asakusafw.yaess.tools.Explain.java

static int execute(String[] args) {
    assert args != null;
    Configuration conf;// w ww  . ja  v  a  2  s  .co m
    try {
        conf = parseConfiguration(args);
    } catch (Exception e) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.setWidth(Integer.MAX_VALUE);
        formatter.printHelp(MessageFormat.format("java -classpath ... {0}", Explain.class.getName()), OPTIONS,
                true);
        e.printStackTrace(System.out);
        return 1;
    }
    try {
        explainBatch(conf.script);
    } catch (Exception e) {
        e.printStackTrace();
        return 1;
    }
    return 0;
}