1. /*
  2. * @(#)Direct-X-Buffer.java 1.45 03/04/23
  3. *
  4. * Copyright 2003 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. import sun.misc.Cleaner;
  10. import sun.misc.Unsafe;
  11. import sun.nio.ch.DirectBuffer;
  12. import sun.nio.ch.FileChannelImpl;
  13. class DirectDoubleBufferRU
  14. extends DirectDoubleBufferU
  15. implements DirectBuffer
  16. {
  17. // For duplicates and slices
  18. //
  19. DirectDoubleBufferRU(DirectBuffer db, // package-private
  20. int mark, int pos, int lim, int cap,
  21. int off)
  22. {
  23. super(db, mark, pos, lim, cap, off);
  24. }
  25. public DoubleBuffer slice() {
  26. int pos = this.position();
  27. int lim = this.limit();
  28. assert (pos <= lim);
  29. int rem = (pos <= lim ? lim - pos : 0);
  30. int off = (pos << 3);
  31. return new DirectDoubleBufferRU(this, -1, 0, rem, rem, off);
  32. }
  33. public DoubleBuffer duplicate() {
  34. return new DirectDoubleBufferRU(this,
  35. this.markValue(),
  36. this.position(),
  37. this.limit(),
  38. this.capacity(),
  39. 0);
  40. }
  41. public DoubleBuffer asReadOnlyBuffer() {
  42. return duplicate();
  43. }
  44. public DoubleBuffer put(double x) {
  45. throw new ReadOnlyBufferException();
  46. }
  47. public DoubleBuffer put(int i, double x) {
  48. throw new ReadOnlyBufferException();
  49. }
  50. public DoubleBuffer put(DoubleBuffer src) {
  51. throw new ReadOnlyBufferException();
  52. }
  53. public DoubleBuffer put(double[] src, int offset, int length) {
  54. throw new ReadOnlyBufferException();
  55. }
  56. public DoubleBuffer compact() {
  57. throw new ReadOnlyBufferException();
  58. }
  59. public boolean isDirect() {
  60. return true;
  61. }
  62. public boolean isReadOnly() {
  63. return true;
  64. }
  65. public ByteOrder order() {
  66. return ((ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN)
  67. ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN);
  68. }
  69. }