1. /*
  2. * @(#)ByteBufferAs-X-Buffer.java 1.17 04/05/03
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. // -- This file was mechanically generated: Do not edit! -- //
  8. package java.nio;
  9. class ByteBufferAsFloatBufferRL // package-private
  10. extends ByteBufferAsFloatBufferL
  11. {
  12. ByteBufferAsFloatBufferRL(ByteBuffer bb) { // package-private
  13. super(bb);
  14. }
  15. ByteBufferAsFloatBufferRL(ByteBuffer bb,
  16. int mark, int pos, int lim, int cap,
  17. int off)
  18. {
  19. super(bb, mark, pos, lim, cap, off);
  20. }
  21. public FloatBuffer slice() {
  22. int pos = this.position();
  23. int lim = this.limit();
  24. assert (pos <= lim);
  25. int rem = (pos <= lim ? lim - pos : 0);
  26. int off = (pos << 2) + offset;
  27. assert (off >= 0);
  28. return new ByteBufferAsFloatBufferRL(bb, -1, 0, rem, rem, off);
  29. }
  30. public FloatBuffer duplicate() {
  31. return new ByteBufferAsFloatBufferRL(bb,
  32. this.markValue(),
  33. this.position(),
  34. this.limit(),
  35. this.capacity(),
  36. offset);
  37. }
  38. public FloatBuffer asReadOnlyBuffer() {
  39. return duplicate();
  40. }
  41. public FloatBuffer put(float x) {
  42. throw new ReadOnlyBufferException();
  43. }
  44. public FloatBuffer put(int i, float x) {
  45. throw new ReadOnlyBufferException();
  46. }
  47. public FloatBuffer compact() {
  48. throw new ReadOnlyBufferException();
  49. }
  50. public boolean isDirect() {
  51. return bb.isDirect();
  52. }
  53. public boolean isReadOnly() {
  54. return true;
  55. }
  56. public ByteOrder order() {
  57. return ByteOrder.LITTLE_ENDIAN;
  58. }
  59. }