1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.io;
20
21 import java.text.DateFormatSymbols;
22 import java.util.Locale;
23
24 import org.eclipse.jetty.util.DateCache;
25
26 public class BufferDateCache extends DateCache
27 {
28 Buffer _buffer;
29 String _last;
30
31 public BufferDateCache()
32 {
33 super();
34 }
35
36 public BufferDateCache(String format, DateFormatSymbols s)
37 {
38 super(format,s);
39 }
40
41 public BufferDateCache(String format, Locale l)
42 {
43 super(format,l);
44 }
45
46 public BufferDateCache(String format)
47 {
48 super(format);
49 }
50
51 public synchronized Buffer formatBuffer(long date)
52 {
53 String d = super.format(date);
54 if (d==_last)
55 return _buffer;
56 _last=d;
57 _buffer=new ByteArrayBuffer(d);
58
59 return _buffer;
60 }
61 }