comparison src/org/eclipse/jetty/io/AbstractBuffer.java @ 1019:f126d30e04a4

start replacing BufferCache with StringCache
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Oct 2016 03:33:42 -0600
parents 2712133d5bce
children 6be43ef1eb96
comparison
equal deleted inserted replaced
1018:4dc1e1a18661 1019:f126d30e04a4
358 358
359 } 359 }
360 return _view; 360 return _view;
361 } 361 }
362 362
363 @Override
363 public int poke(int index, Buffer src) 364 public int poke(int index, Buffer src)
364 { 365 {
365 _hash=0; 366 _hash=0;
366 /* 367 /*
367 if (isReadOnly()) 368 if (isReadOnly())
437 } 438 }
438 439
439 public int put(Buffer src) 440 public int put(Buffer src)
440 { 441 {
441 int pi = putIndex(); 442 int pi = putIndex();
442 int l=poke(pi, src); 443 int l = poke(pi, src);
443 setPutIndex(pi + l); 444 setPutIndex(pi + l);
444 return l; 445 return l;
445 } 446 }
446 447
447 public void put(byte b) 448 public void put(byte b)
591 } 592 }
592 buf.append('}'); 593 buf.append('}');
593 return buf.toString(); 594 return buf.toString();
594 } 595 }
595 596
596 /* ------------------------------------------------------------ */
597 @Override 597 @Override
598 public String toString() 598 public String toString()
599 { 599 {
600 if (isImmutable()) 600 if (isImmutable())
601 { 601 {
604 return _string; 604 return _string;
605 } 605 }
606 return new String(asArray(), 0, length()); 606 return new String(asArray(), 0, length());
607 } 607 }
608 608
609 /* ------------------------------------------------------------ */ 609 @Override
610 public String toString(String charset) 610 public final String toString(String charset)
611 { 611 {
612 try 612 try
613 { 613 {
614 byte[] bytes=array(); 614 byte[] bytes=array();
615 if (bytes!=null) 615 if (bytes!=null)
622 LOG.warn("",e); 622 LOG.warn("",e);
623 return new String(asArray(), 0, length()); 623 return new String(asArray(), 0, length());
624 } 624 }
625 } 625 }
626 626
627 /* ------------------------------------------------------------ */ 627 @Override
628 public String toString(Charset charset) 628 public final String toString(Charset charset)
629 { 629 {
630 try 630 try
631 { 631 {
632 byte[] bytes=array(); 632 byte[] bytes=array();
633 if (bytes!=null) 633 if (bytes!=null)