1090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/* 20888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Copyright (C) 2009 The Guava Authors 3090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 4090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Licensed under the Apache License, Version 2.0 (the "License"); 5090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * you may not use this file except in compliance with the License. 6090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * You may obtain a copy of the License at 7090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 8090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * http://www.apache.org/licenses/LICENSE-2.0 9090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 10090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Unless required by applicable law or agreed to in writing, software 11090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * distributed under the License is distributed on an "AS IS" BASIS, 12090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * See the License for the specific language governing permissions and 14090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * limitations under the License. 15090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */ 16090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 170888a09821a98ac0680fad765217302858e70fa4Paul Duffinpackage com.google.common.escape; 18090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 19090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/** 200888a09821a98ac0680fad765217302858e70fa4Paul Duffin * @author Jesse Wilson 21090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */ 221d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringertfinal class Platform { 230888a09821a98ac0680fad765217302858e70fa4Paul Duffin 240888a09821a98ac0680fad765217302858e70fa4Paul Duffin private static final char[] CHAR_BUFFER = new char[1024]; 250888a09821a98ac0680fad765217302858e70fa4Paul Duffin 260888a09821a98ac0680fad765217302858e70fa4Paul Duffin static char[] charBufferFromThreadLocal() { 270888a09821a98ac0680fad765217302858e70fa4Paul Duffin // ThreadLocal is not available to GWT, so we always reuse the same 280888a09821a98ac0680fad765217302858e70fa4Paul Duffin // instance. It is always safe to return the same instance because 290888a09821a98ac0680fad765217302858e70fa4Paul Duffin // javascript is single-threaded, and only used by blocks that doesn't 300888a09821a98ac0680fad765217302858e70fa4Paul Duffin // involve async callbacks. 310888a09821a98ac0680fad765217302858e70fa4Paul Duffin return CHAR_BUFFER; 32090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson } 331d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert 341d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert private Platform() {} 35090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson} 36